HTML - Html, Vbscript And Javascript -- Passing Variables
No. I think I got misunderstood.
in my Page1.html I have this: <a href="Page2.html?ProductID='1234'>Page 2</a> So, this would open my Page2 with variable ProductID=1234. When it opens, how could my VBScript in there pick up the received variables? Similar TutorialsHello, I'm a newbie in HTML Development. Could someone please help me on this? I'm calling another HTML ie. http://www.mywebsite.com/Page2.html?ID=1234 Basically, I'm on Page1.html and there's a link there that I'm referencing to call Page2 but passing a variable of ID=1234. How can I use this ID=1234 in Page2's vbscript? In my Page2.html, I have a vbscript section and I want to get the passed variable. How can I do this? What should I put in: <script type="text/vbscript"> strProductID= ??????? ... </script> Thanks in advance! Hey, I'm trying to pass a variable from some HTML code to JavaScript and I'm having some trouble. For example: HTML Code: <form name ="columnList" onchange="submitForm(this);"> Column: <c:forEach var="columnitem" items="${columns}"> <c:if test="${columnitem.name != this.document.columnList.name}"> <input type="checkbox" name="selectedColumns" id="${columnitem.name}" value="${columnitem.name}">${columnitem.name} </input> <script type="text/javascript" language ="JavaScript"> var col = document.columnList.columnitem.name; setColumns(col); </script> </c:if> </c:forEach> I'm trying to get the columnitem name from the HTML portion to the script. And I know that columnitem.name works for the check boxes. Can anyone help me out? In a regular form with text fields, can I pass the imput from the user directly into a hidden textarea from multiple fields intertwined with html? Example: <form> <input type="text" name="firstname"> <input type="text" name="lastname"> <input type="text" name="occupation"> <input type="hidden" value="some html + firstname + some html + lastname + some html + occupation"> </form> I think this might require some javascript. Is something like this possible? I am trying to pass variables to a php script from a text link. This is how I was doing it: <a href="page.php?variable=something"> However, my question is: is there a way to do this so that the variables are NOT included in the URL? So the destination URL would be 'page.php', and not 'page.php?variable=something', but the variable would still be passed? THANKS! Hey guys, I'm fairly new to programming web forms on my own. (I've used some Joomla/Mambo components that eased the process). I understand the basics of forms and what not, but was curious as to what the best way to pass variables from an email (pre-filled) to a form would be without using Server-Side Scripting of any kind. (I could easily write a PHP page to do so, but on this specific project I don't have access to any kind of scripting on the server side). I have thought about doing it one of two ways. The first way would be to write some Javascript that saves the fields I need as cookies and then calling those cookies back on the webform. The other way, was to pass the variables through the URL. I don't know if this is possible without Server-Side Scripting or not. I'm sure I could hack up some sort of Javascript code to read the URL and break it into the relevant variables but that seems like a lot of work for something so simple. Is there a way to use the GET method at all to pull those variables from the URL? Also, sorry for not posting this in the Client-Side Scripting forum, but I wasn't sure if there were other solutions to this problem that wouldn't require any scripting at all. Thanks Again, -Ian- Hi, I've got an HTML form running on an internal intranet site. It contains a vbscript that pulls the username from the local machine. Is there a way to put that username in a text box on the html page for submission later? Please see the code below for reference thanks <html> <head> </head> <body> <script type="text/vbscript"> set objNetwork = createobject("wscript.network") document.write(objNetwork.Username) </script> </body> </html> Hi Everyone I have a problem with my form in that I have an html page with a dropdown list. I need the value selected to be passed to another html file. However I need this done with html and not javascript/css/asp etc. As an e.g. of what I have: <form name="connect" action="trace.php" method="get"> <select name="sites"> <option selected option value="http://www/connect.php">Choose A Site</option> <option value="http://10.20.12.50" name="Site1">Site1</option> <option value="http://10.20.12.55" name="Site2">Site2</option> <option value=http://10.20.12.40" name="Site3">Site3</option> </select> <br><br> <input type="Submit" value="Traceroute"> </form> So if the user selects site2 I need the name (or value) from the option field sent to trace.php and from the trace.php website i need to retrieve the value selected from the above. Can someone please help me by telling me how to do this? At the moment I cannot retrieve the value from the trace.php site. I have used $_POST & $_GET, but neither seem to work and I am not sure what I am doing wrong. TIA Hi, I have trouble to pass arguments to the main class in applets. There are three different class within the Main class in the applets, Easy.class, Intermediate.class and Expert.class. In HTML, how can I pass arguments to applets so that they can interact with each other by calling the three classes from the main class? The codes a HTML Code: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>Jigsphere Main</title> <link href="../../../Users/User/Documents/JigSphere.com/MainPage.css" rel="stylesheet" type="text/css" /> <!--[if IE]> <style type="text/css"> /* place css fixes for all versions of IE in this conditional comment */ .twoColElsLtHdr #sidebar1 { padding-top: 30px; } .twoColElsLtHdr #mainContent { zoom: 1; padding-top: 15px; } /* the above proprietary zoom property gives IE the hasLayout it needs to avoid several bugs */ </style> <![endif]--> <style type="text/css"> <!-- .style1 { font-family: Geneva, Arial, Helvetica, sans-serif; color: #000000; background-color: #3366FF; } body { background-color: #00CCFF; } --> </style> <script src="../../../Users/User/Documents/JigSphere.com/Scripts/AC_RunActiveContent.js" type="text/javascript"></script> </head> <body class="twoColElsLtHdr"> <div id="container"> <div id="header"> <h1 align="center" class="style1"><img src="Logo.gif" alt="logo" width="354" height="84" /><!-- end #header --> </h1> </div> <div id="sidebar1"> <h3> <script type="text/javascript"> AC_FL_RunContent( 'codebase','http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,28,0','width','306','height','309','title','Logo','src','../../../Users/User/Documents/JigSphere.com/bluesphere','quality','high','pluginspage','http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash','movie','../../../Users/User/Documents/JigSphere.com/bluesphere' ); //end AC code </script> <noscript> <object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,28,0" width="306" height="309" title="Logo"> <param name="movie" value="../../../Users/User/Documents/JigSphere.com/bluesphere.swf" /> <param name="quality" value="high" /> <embed src="../../../Users/User/Documents/JigSphere.com/bluesphere.swf" quality="high" pluginspage="http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash" type="application/x-shockwave-flash" width="306" height="309"></embed> </object> </noscript> </h3> <!-- end #sidebar1 --></div> <div align="center"> <p><img src="Easy button.png" alt="easy" width="264" height="64" /></p> <p> <!-- This clearing element should immediately follow the #mainContent div in order to force the #container div to contain all child floats --> <img src="Intermediate button.png" alt="intermediate" width="264" height="64" /></p> <p><img src="Expert button.png" alt="expert" width="264" height="64" /></p> <p><img src="High Scores button.png" alt="high scores" width="264" height="64" /></p> <p align="center"><img src="Quit.png" alt="quit" width="113" height="65" /><br class="clearfloat" /> </p> </div> <div id="footer"> <p align="center">JigSphere™</p> <!-- end #footer --></div> <!-- end #container --></div> </body> </html> I want to embed the codes in the image button.png, once user click any of the button, the requested class will be passed by applets to HTML and displaying the page in HTML. This is what I got.. HTML Code: <HTML> <HEAD> <TITLE> JigSphere Main Page </TITLE> </HEAD> <BODY> <APPLET CODE = "TheMain.class" WIDTH = "1250" HEIGHT = "650"> <PARAM NAME="easy" value ="JigSphereEasy.class"> <PARAM NAME="intermediate" value ="JigSphereInt.class"> <PARAM NAME="expert" value ="JigSphereEx.class"> </applet> Is it correct? what should I put then in the param name? and the value? I'd like to have a html file where i can pass over the variables from another html file i.e. title = "Image 01" Image = image.jpg description = "image 01 description test" then with a link open the html file with this variables. thanks. Hey guys. Thanks in advance for help on this. I am simply (what I think should be simple) trying to carry over answers submitted by a user from one page to the other. For example, using the scripting below on my homepage, truquill.com a user would enter 'Tom Smith'. How do I carry over that information over to a whole new page - truquill.com/tenant through html? HTML Code: <form name="input" action="http://www.truquill.com/tenant.html" method="get"> First name: <input type="text" name="firstname"><br> Last name: <input type="text" name="lastname"><br> <input type="submit" value="Submit"> </form> I have looked at server sider related stuff but that was way over my head. Was hoping there might be a solution in html? Thoughts? Thanks! Good afternoon, I have a program that I am writing in HTML and Javascript. Here is what I want to do. I have a menu that goes to multiple pages. When I get to a certain page, I want a variable set that when I return to the menu, I can use that variable to display a check mark. I need to keep the functionality simple, so I can't use ASP or write to cookies. I have two ideas on what to do, but none of them worked. 1) To use a .js file. I can get the .js file to hold the variable on just the page that called it, but when I go to another page and access the .js file, I lose the variable. 2) To use frames, where I pass the variable dynamically to one frame and so I can access it later. I don't know what to do. I've tried using a combo of the above ideas, but nothing has worked. Any help would be greatly appreciated. Thanks. Im not sure if this is posted in the right place but anywho im just wondering if this is possible (note:im a total noob) i have a table HTML Code: <table border="0"> <tr> <!--the embed code of a youtube video--> </tr> <tr> <p> video #1<br /> video#2 <br /> video#3 <br/ > and so on </p> </tr> and im wondering if its possible to click on one of the video #1,2 or 3 and set a javascript variable to a certain amount and change the embed code of the youtube video corresponding to the video # you selected. Is this possible or am i dreaming?? Thank You, why789 Hi All, This doesn't completely relate to HTML, I am more asking questions about Javascript but are related to HTML and CSS. Anyways here are my questions: 1 - Can you create a javascript file (.js) with out using HTML? If so how would you view this file? 2 - Can you link a CSS file to a Javascript file? 3 - Is there a certain program which is dedicated to view/making Javascript files? 4 - Is it legal to call a program that I make JavaScript Beam? and have copyrights to the name JavaScript Beam? If that is illegal then would it be legal (inclduing copyrights) to call the program I make JS Beam? Thanks just i load one template in the page, and i create one button in that template, but when i reduce the size of the page, the template will move but the button will exist, i mean that will be constant... how to avoid that? Why can't this HTML Code: HTML Code: <table class='tableborder' cellpadding='6' cellspacing='1' border='0' width='100%'><tr><td class='maintitle' colspan='3' style='text-align:center'><a href='/index.php?showtopic='+ topicid +'' title='View the thread'>'+ maintitle +'</a></td></tr><tr><td align='center' class='row2' border='0'>Winner's Avatar</td><td align='center' class='row2' border='0'>Winner's Entry</td><td align='center' class='row2' border='0'>Winner's Prize</td></tr><tr><td align='center' class='row4' border='0'><a href='/index.php?showuser='+ userid +''><img src=''+ avatar +'' border='0' alt=''+ username +''s Avatar' /></a></td><td align='center' class='row3' border='0'><img src=''+ signature +'' alt=''+ username +''s Entry' /></td><td align='center' valign='middle' class='row4' border='0'><fieldset class='fieldset'><legend>Prize</legend><div><b>Name:</b> <a href='/index.php?showuser='+ userid +''>'+ username +'</a></div><div><b>Prize:</b> '+ prize +'</div><div><b>Admin Rating:</b> <img src=''+ ratimg +'' alt=''+ opinion +'' /></div><div><a href='/index.php?showtopic='+ topicid +''>Click here to visit the thread.</a></div></fieldset></td></tr></table> Go into JavaScript like this: HTML Code: <script> var topicid = ''; /* Something in here. */ var maintitle = ''; /* Something in here. */ var userid = ''; /* Something in here. */ var avatar = ''; /* Something in here. */ var username = ''; /* Something in here. */ var signature = ''; /* Something in here. */ var prize = ''; /* Something in here. */ var ratimg = ''; /* Something in here. */ var opinion = ''; /* Something in here. */ document.write('<table class='tableborder' cellpadding='6' cellspacing='1' border='0' width='100%'><tr><td class='maintitle' colspan='3' style='text-align:center'><a href='/index.php?showtopic='+ topicid +'' title='View the thread'>'+ maintitle +'</a></td></tr><tr><td align='center' class='row2' border='0'>Winner's Avatar</td><td align='center' class='row2' border='0'>Winner's Entry</td><td align='center' class='row2' border='0'>Winner's Prize</td></tr><tr><td align='center' class='row4' border='0'><a href='/index.php?showuser='+ userid +''><img src=''+ avatar +'' border='0' alt=''+ username +''s Avatar' /></a></td><td align='center' class='row3' border='0'><img src=''+ signature +'' alt=''+ username +''s Entry' /></td><td align='center' valign='middle' class='row4' border='0'><fieldset class='fieldset'><legend>Prize</legend><div><b>Name:</b> <a href='/index.php?showuser='+ userid +''>'+ username +'</a></div><div><b>Prize:</b> '+ prize +'</div><div><b>Admin Rating:</b> <img src=''+ ratimg +'' alt=''+ opinion +'' /></div><div><a href='/index.php?showtopic='+ topicid +''>Click here to visit the thread.</a></div></fieldset></td></tr></table>') </script> I want to have a similar feature that this page has http://dtlr.com/shoes/shoes.html only the part that has the 4 thumbnails of the cropped shoes and then the larger image of the shoe next to it. Is this possible to build with html or javascript or is advanced css or something else needed? thanks K so I'm making my brother an inventory website that leads to a digital order sheet. On the order sheet, it has a dropdown of the items he has in the database. It's supposed to show the quantity of what he has in stock, but here's the thing: In this database, there are two tables, called Dishes, and Cables. These two tables are assigned to 1 id, so that I can display them in <td id = 'quantity'/>. The problem is, it displays the Cables only, but I want it to be so that if I select one of the dishes, it selects the quantity for the dishes, and if I select one of the cables. Here's the code I have. Code: <html> <head> <script type="text/javascript" > var data = null; var data2 = null; function GETSTUFF(stuff) { var xmlhttp = new XMLHttpRequest(); xmlhttp.open('GET', stuff, false); xmlhttp.send(); return xmlhttp.responseText; } function buildList() { data = eval('('+ GETSTUFF('inventory_2.php') +')'); console.log(data); for (var i=0;i<data.length;i++) { document.getElementById('materials').innerHTML += '<option onclick="showQuantity(\''+ data[i]['Quantity'] +'\'">'+ data[i]['Supplier'] +'</option>'; } data2 = eval('('+ GETSTUFF('inventory_21.php') +')'); console.log(data2); for (var i2=0;i2<data2.length;i2++) { document.getElementById('materials').innerHTML += '<option onclick="showQuantity(\''+ data2[i2]['Quantity (Boxes)'] +'\'">'+data2[i2]['Type'] +'</option>'; } } function showQuantity() { var supplier = document.getElementById('materials').options[document.getElementById('materials').selectedIndex].value; var type = document.getElementById('materials').options[document.getElementById('materials').selectedIndex].value; var amount = 0; var amount2 = 0; for (var i=0;i<data.length;i++) { if (data[i]['Supplier'] == supplier) { amount = (data[i]['Quantity']); } } document.getElementById('quantity').innerHTML = 'Quantity : '+amount; for (var i2=0;i2<data2.length;i2++) { if (data2[i2]['Type'] == type) { amount2 = (data2[i2]['Quantity (Boxes)']); } } document.getElementById('quantity').innerHTML = 'Quantity (Boxes) : '+amount2; } </script> </head> <body onload="setTimeout('buildList()' ,100)"/> <center> <img src="images.jpg" width=125px height=125px/> <br> <font size="8" color="grey" face="purisa">Home </font> <font size="8" color="red" face="purisa"> Communications</font> <br> <font size="5" color="grey" face="purisa">Order </font> <font size="5" color="red" face="purisa"> Sheet</font> <br> <table border="3" width="100%"> <tr> <th>Material:</th> <th>Quantity in stock:</th> <th>Quantity needed:</th> </tr> <tr> <td> <select id="materials" name= "" onchange = "showQuantity()"> <option disabled>Select</option> </select> </td> <td id="quantity"> </td> <td> <form> <input type = "quantityNeeded" /> </form> </td> </tr> </table> <br> <input type = "button" value="Submit"/> </center> </body> </html> I know the if statement involves selectedIndex, but I can't figure it out. Please help. So I want to make an image that has mouseover tables that pop up. This is what the code looks like now: Code: <html> <table> <tr><td><img src= "pic.bmp" usemap="#mapareas"/></td></tr> </table> <map NAME ='mapareas'> <script language='JavaScript' type='text/javascript'> function show(id) { document.getElementById(id).style.visibility='visible'; return true; } function hide(id) { document.getElementById(id).style.visibility='hidden'; return true; } </script> <area shape = "rect" coords="0,0,100,100" title="one" onmouseover='javascript:show('one') onmouseout='javascript:hide('one')> <area shape = "rect" coords= "150,0,250,100" title="two" onmouseover='javascript:show('two') onmouseout='javascript:hide('two')> <area shape = "rect" coords= "0,150,100,250" title="three" onmouseover='javascript:show('three') onmouseout='javascript:hide('three')> <area shape = "rect" coords= "150,150,250,250" title="four" onmouseover='javascript:show('four') onmouseout='javascript:hide('four')> <area shape = "default" title="The Rest"> </map> <table border=0 cellPadding=0 cellSpacing=1 id='one' style='position:absolute; left:10px; top:120px; background:lightGrey; visibility:hidden'> <tr><td>ONE</td></tr> </table> <table border=0 cellPadding=0 cellSpacing=1 id='two' style='position:absolute; left:10px; top:120px; background:lightGrey; visibility:hidden'> <tr><td>TWO</td></tr> </table> <table border=0 cellPadding=0 cellSpacing=1 id='three' style='position:absolute; left:10px; top:120px; background:lightGrey; visibility:hidden'> <tr><td>THREE</td></tr> </table> <table border=0 cellPadding=0 cellSpacing=1 id='four' style='position:absolute; left:10px; top:120px; background:lightGrey; visibility:hidden'> <tr><td>FOUR</td></tr> </table> </html> everything is ok when the page is first loaded, but when I try the mouseovers, firefox's error console gives me this message: "syntax error javascript:show(" and "syntax error javascript:hide(" Can someone help me figure out what is going wrong? Thanks |