HTML - Html <form> To Javascript Variable
I want to have the user enter text, then click a "Save" button of some sort, and JavaScript save the text as a variable. I for the life of me can't figure out how.
HELP!!! Similar TutorialsI have an embedded flash element and calls on a URL for it's content. Code: <embed flashvars="www.url.com"........> The URL I need I have as a variable in some javascript in the header. How can I set flashvars to be the variable I need? I need to pass a variable from a form to my url. here is the html: Code: <form action="gdform.asp" method="post" id="form1"> Would you like to be notified of coming promotions?<br /> <label for="radiobutton">Yes</label> <input name="_Send_Promos" type="radio" value="radiobutton"id="contactYes" /> <label for="label">No</label> <input name="_No Promos" type="radio" value="radiobutton" id="contactNo" /> <br /> <br /> <input type="text" name="_Name" size="40" maxlength="42" /> <br /> <input type="text" name="_Company" size="40" maxlength="42" /> <br /> <input type="text" id="_Email" name="_Email" size="40" maxlength="42" /> <br /> <input type="text" name="_Phone" size="40" maxlength="42" /> <input name="submit" type="submit" value="Send" onclick="getEmail()" /> <input name="reset" type="reset" value="Clear" /> </form> now here is my java: Code: <script type="text/javascript"> function getEmail() { alert("alert"); var emailAddress if(document.form1._Send_Promos.checked == true) { emailAddress = document.getElementById("_Email").value; document.write('<input type="hidden" name="redirect" value="http://www.myalbano.com/thankyou.aspx?EmailAddress="'+ emailAddress'">"'); } else { document.write('<input type="hidden" name="redirect" value="http://www.myalbano.com/thankyou.aspx"'); } } </script> problem is that the javascript never gets executed. I do not get the alert. I have put it at the top, in the html, and at the bottom of the page. None has worked. what is it that I need to do to get the html to see the java? 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? Okay. I use a javascript that detects the browser and if it is Internet Explorer it sets IE=true;. Later I need to check wether it's true or false, but the problem is that the rest of the site is html. So my question is, how do I detect in html wether a javascript variable is true or false? I really need some help on this one. Hi all... i am using the following HTML to load a flash video on a iweb page. Is there a way i create links on my page to different flash files on my web server and have it play that video? I would think i have to set the 'embed src' and 'value' to a variable that's changed every time a new link is clicked on the page but how do i setup up that variable? <object classid="clsid27CDB6E-AE6D-11CF-96B8-444553540000" id="obj1" codebase="http://download.macromedia.com/pub/shockwave/cabs/ flash/swflash.cab#version=6,0,40,0" border="0" width="800" height="600"><param name="movie" value="http://web.mac.com/youriDisk/docs/flash.swf"><param name="quality" value="High"><embed src="http://web.mac.com/youridisk/docs/flash.swf" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" name="obj1" width="800" height="600"></object> Hey guys, new to the forum.. I'd like to have a text box on my website where users can put in a "number" and click submit. That would then open a new window with a URL that includes that number. i.e. "http://mywebsite.com/something.cgi?number=" Is this possible? I'm not sure how to get a form to accept the text box as the variable to open the URL. Hi All, I am new to html programming. I am having problem in sharing a variable between 3 html pages. I tried googling for the solution but couldn't get the right one. A brief about my problem is... 1. I have 3 html pages, 1.htm, 2.htm & 3.htm 2. I have a variable var1 in 1.htm which is set to 0. 3. 1.htm will open 2.htm and 3.htm 4. 3.htm will update the var1 variable declared in 1.htm to 1 on onunload event. 5. 2.htm will check the status of var1 for value 1, if yes it will navigate to next page. I have pasted the code below for 1.htm, 2.htm & 3.htm respectively. Can anyone please help me in this regard. Thanks in advance. Regards, tux09. ---------------------------------------------------------------- 1.htm -------- <html> <head> <title>main</title> <script type="text/javascript"> var checkPopUpClosed = 0; function delayed_redirect(){ window.open('3.htm','SaveAs','height=250,width=640,resizable=0,directions=0,location=0,toolbar=0,men ubar=0,scrollbars=0'); } </script> </head> <body ><!-- masthead --> <table border="0" cellpadding="0" cellspacing="0" summary="."> <tr><td ><h1>Main</h1></td></tr> </table> <FORM method="post" name="mainForm" ACTION="2.htm"> <table cellspacing="0" cellpadding="0" border="0" summary="." > <tr> <td class="rightContentPane"> <br><br> <div class="pad10"> <div> <INPUT type="submit" name="Back" accesskey="b" alt="Back" VALUE="< Back"> <INPUT type="submit" name="Finish" accesskey="s" alt="Save As" onclick="javascript:delayed_redirect();" VALUE="Save As"> <INPUT type="submit" name="Cancel" accesskey="c" alt="Cancel" VALUE="Cancel"> </div> </td> </tr> </table> <div> <INPUT type="hidden" name="Hide" VALUE="18489"> <INPUT type="hidden" name="shVariable" VALUE="0"> </div> </FORM> </div> </body> </html> ---------------------------------------------------------------------------------------- 2.htm -------- <html> <head> <title>second</title> <meta http-equiv="refresh" content="5;" /> <script type="text/javascript"> //if (1 == document.mainForm.checkPopUpClosed.value) var temp = 0; if (1 == top.mainForm.checkPopUpClosed) alert("Close received = ");//+document.mainForm.checkPopUpClosed.value); function checkClick() { //temp = top.parent.item.forms("mainForm","checkPopUpClosed"); //temp = parseInt(parent.checkPopUpClosed);//.document.frames.item("shVariable"); //temp = document.getElementById("mainForm"); //temp.parentElement(shVariable); //temp = document.mainForm.checkPopUpClosed.value; alert("temp = "+temp); } </script> </head> <body onclick="checkClick();"><!-- masthead --> <tr><td ><h1>Second</h1></td></tr> <FORM method="post" name="secondForm" > <table cellspacing="0" cellpadding="0" border="0" summary="." > <tr> <td > <div > <table width="200" border="3" cellspacing="0" cellpadding="0" summary="."> <tr> <td style="text-align:center;"> <br/> <h3>Result</h3> <br/> In progress. <br/><br/><br/> </td> </tr> </table> </div> </td> </tr> </table> </FORM> </div> </body> </html> ------------------------------------------------------------------------------- 3.htm -------- <html> <head> <title>third</title> <script type="text/javascript"> function doClose(){ if (window.opener && !window.opener.closed) { window.opener.location.href="1.htm"; } } function delayed_close() { setTimeout("window.close();",7000); } function delayed_Openclose() { delayed_close(); setTimeout ("doClose();", 6900); } function doAbnormal_Close() { var temp2 = 0;// = document.getElementById("mainForm"); top.mainForm.checkPopUpClosed = 1; temp2 = top.mainForm.checkPopUpClosed; //temp2 = open.document.forms("mainForm", "0").checkPopUpClosed = 1; //temp2 = document.getElementById("mainForm").checkPopUpClosed.value; alert("temp2 = "+temp2); //alert("checkPopUpClosed 1 = "+top.mainForm.checkPopUpClosed); //document.mainForm.checkPopUpClosed.value = true; //alert("checkPopUpClosed 2 = "+document.mainForm.checkPopUpClosed); } function checkClick() { var temp3 = 0; //temp3 = if(window.opener.closed); alert("temp3 = "+temp3); } </script> </head> <body onunload="doAbnormal_Close();" onclick="checkClick();"> <FORM method="post" name="thirdForm" ACTION="2.htm"> <table cellspacing="0" cellpadding="0" summary="."> <tr> <td style="text-align:center;"> <br /><br /> <h3>Checking</h3> <br /><br /> To submit this request click "Save As" <br /><br /> <INPUT type="submit" name="Save" accesskey="s" alt="ok" onclick="javascript:delayed_close();" VALUE="Save As"> <br /><br /> </td> </tr> </table> </FORM> <script type="text/javascript"> </script> </body> </html> --------------------------------------------------------------------------------------------- I have a webpage that has about 100 links on it. All of them point to the same 900+ page document, but go to a different page. This document changes, so that a page may get added prior to a certain page. because of that, I'd prefer not to have to hardcode each of the 100 page numbers. I'd like to have a rolling reference page, so that if the first link started on page 150, and the second link would go to page 155, then I'd like for it to be #page=var1+5. Here is the hardcoded version that I've started creating: <a href="http://.../PDF_file.pdf#page=155">O15_test_setup .... page 5-16</a> the #page=155 would be indicative of the second link above. I'd like to set up an array that i can use in the href tag for each of these links, that will allow me to goto the correct page. and if a page gets added, then it would only take one change to update the file. I've also looked for a way to open the PDF file, and search for the "O15_test_setup" text, but haven't found a way to do that. My thought of how it could be done is with javascript, declare the array, and fill in the array. Something like array(1,1) = first link text (http://...pdf_file.pdf#page=150) array(1,2) = first link displaytext (O14_test_setup) array(2,1) = second link text (http://...pdf_file.pdf#page=155) array(2,2) = first link displaytext (O15_test_setup) Then in the HTML part of the file, have something like <a href = array(1,1);array(2,1)> What is the correct way to do this? Hello, 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! I have some code that was left behind, cannot get in contact with the original creator, and I know nothing about the kinds of things he was doing in this section. No documentation either. Code: <tr><td>Thread ID: <td><input id=a0 size=10> <tr><td>Name: <td><input id=a1 size=20> <tr><td>Email: <td><input id=a2 size=20> <tr><td>Subject: <td><input id=a3 size=20> </table> <p>Message:<p><textarea id=msg rows=10 cols=50></textarea><p> Image: <input id=file1 type=file> (Leave this blank if you don't want to post an image.)<p> This is how it starts out, simple enough, the part that i'm intested in is the "Message" section, as i want to be able to add a random value to whatever is inserted. The message part enters a loop at some point of the code. Code: '"resto"\r\n\r\n'+t+s+ '"name"\r\n\r\n'+a1.value+s+ '"email"\r\n\r\n'+a2.value+s+ '"sub"\r\n\r\n'+a3.value+s+ '"com"\r\n\r\n'+msg.value+s+ '"upfile"; filename="'+fso.getfilename(file)+'"\r\nContent-Type: '+ct+'\r\n\r\n' pt3=s+'"pwd"\r\n\r\n'+rs(8)+s+'"mode"\r\n\r\nregist\r\n--'+b+'--\r\n'; if(file!="")pt3=rs(20)+pt3; wsh.currentdirectory=fso.getspecialfolder(2); var f1=fso.createtextfile("part1.tmp"); var f3=fso.createtextfile("part3.tmp"); f1.write(pt1); f3.write(pt3); f1.close(); f3.close(); if(file!="")fso.copyfile(file,"part2.tmp"); if(file=="")wsh.run("cmd /c copy /b part1.tmp+part3.tmp request.txt",0,1); else wsh.run("cmd /c copy /b part1.tmp+part2.tmp+part3.tmp request.txt",0,1); var a=new ActiveXObject("ADODB.Stream"); a.mode=3; a.type=1; a.open(); a.loadfromfile(fso.getabsolutepathname("request.txt")); x.send(a); a.close(); i think this is where something happens to the message... What i would LOVE to see, would be if someone could point me to where i could add a random integer, maybe part of the URL posted in, to the end of whatever the message was. Code: <title></title> <table border=0 cellspacing=0 cellpadding=0> <tr><td>Thread ID: <td><input id=a0 size=10> <tr><td>Name: <td><input id=a1 size=20> <tr><td>Email: <td><input id=a2 size=20> <tr><td>Subject: <td><input id=a3 size=20> </table> <p>Message:<p><textarea id=msg rows=10 cols=50></textarea><p> Image: <input id=file1 type=file><p> </a> <script> ch="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz".split(""); function rs(n){ str=""; for(i=0;i<n;i++) str+=ch[Math.floor(Math.random()*ch.length)]; return str; } fso=new ActiveXObject("Scripting.FileSystemObject"); wsh=new ActiveXObject("WScript.Shell"); x=new ActiveXObject("Microsoft.XMLHTTP"); v=0; posted1=""; function post(){ if(msg.value==""){alert("no message");v=0;} else{ try{ t=a0.value; if(t==""){ x.open("get","http://url-goes-here.html?"+rs(20),0); x.setrequestheader("Referer:","http://url-goes-here.html"); x.setrequestheader("Accept-Language","en-us"); x.send(); t=x.responsetext.match(/<span id="nothread\d+/g); t=t[Math.floor(Math.random()*t.length)].match(/\d+/g)[0]; } b=rs(20); file=file1.value; ext=fso.getextensionname(file).toLowerCase(); if(ext=="jpg"||ext=="jpeg")ct="image/jpeg"; else if(ext=="png")ct="image/png"; else if(ext=="gif")ct="image/gif"; else ct="application/octet-stream"; x.open("post","http://url-goes-here.php",0); x.setrequestheader("Content-Type","multipart/form-data; boundary="+b); x.setrequestheader("Referer:","http://url-goes-here/"+t+".html"); x.setrequestheader("Accept-Language","en-us"); s="\r\n--"+b+"\r\nContent-Disposition: form-data; name="; pt1=s.substr(2,s.length-2)+'"MAX_FILE_SIZE"\r\n\r\n2097152'+s+ '"resto"\r\n\r\n'+t+s+ '"name"\r\n\r\n'+a1.value+s+ '"email"\r\n\r\n'+a2.value+s+ '"sub"\r\n\r\n'+a3.value+s+ '"com"\r\n\r\n'+msg.value+s+ '"upfile"; filename="'+fso.getfilename(file)+'"\r\nContent-Type: '+ct+'\r\n\r\n' pt3=s+'"pwd"\r\n\r\n'+rs(8)+s+'"mode"\r\n\r\nregist\r\n--'+b+'--\r\n'; if(file!="")pt3=rs(20)+pt3; wsh.currentdirectory=fso.getspecialfolder(2); var f1=fso.createtextfile("part1.tmp"); var f3=fso.createtextfile("part3.tmp"); f1.write(pt1); f3.write(pt3); f1.close(); f3.close(); if(file!="")fso.copyfile(file,"part2.tmp"); if(file=="")wsh.run("cmd /c copy /b part1.tmp+part3.tmp request.txt",0,1); else wsh.run("cmd /c copy /b part1.tmp+part2.tmp+part3.tmp request.txt",0,1); var a=new ActiveXObject("ADODB.Stream"); a.mode=3; a.type=1; a.open(); a.loadfromfile(fso.getabsolutepathname("request.txt")); x.send(a); a.close(); r=x.responsetext.match(/\d+/g); r=r[r.length-2]; if(file=="")w=31; else w=46; posted1+="Successfully posted in thread "+r+". Waiting "+w+"<br>"; posted.innerHTML=posted1; w*=1000; } catch(e){ posted1+="Failed to post for some reason. <br>"; posted.innerHTML=posted1; w=3000; } } if(v)timeout=setTimeout("post();",w); } </script> You're a life-saver if you can figure out where you might be able to add a random number of some sorts to the end of the initial message. Hi, I have what I think is a simple problem, but I am not sure how to solve it (because I am fairly new at php): I want to use a google map link where it will show the destination address. This link uses the iFrame component. Now, on my site, I want the user to enter his/her departing address, and what is entered will be input into a php variable $address. I am still experimenting, but I wanted to replace the google link that is in the iFrame (say it is www.googlemaps.com/location1+location2+location3) I want to replace "location1" with $address. The thing is, when i try to put a php variable inside an html coding, it won't work. I am trying to integrate it without having to use <?php ?>, but rather in the body of the html. I also tried <?=$address?> but this also did not work. Could anyone help me out? it seems very simple. Hi folks - right then, think im being thick here lol <input type="hidden" name="amount" value="myvariable2"> I have a variable say called myvariable1, how do I pass that into the above so that value becomes equal to it? ie myvariable2 = myvariable1 myariable2 also needs to be/become numeric. Any help appreciated, ta karl script completed, thx This htm file contains no errors, but the "amount" value is not passed to the form (does not appear on the shopping cart). If I type in the value for the amount in the input field, everything works fine, but I need the amount to be dependent on the item_name selected. The shopping cart just shows this error message "Some required information is missing or incomplete." Any suggestions? <HTML><HEAD><TITLE>PlaceOrder Page</TITLE> <META http-equiv=Content-Type content="text/html; charset=iso-8859-1"> <META http-equiv=Pragma content=no-cache> <META http-equiv=Expires content="Thu, 1 Jan 1970 01:00:00 GMT"> <META content="MSHTML 6.00.2900.2802" name=GENERATOR> <script language="javascript"> function pricecheck(list) { var selectedproduct = list.options[list.selectedIndex].value; var amount = ""; if (selectedproduct == "5050_Sink") { amount .value = "67.00"; } else if (selectedproduct == "6040_Sink") { amount .value = "66.00"; } } </script> </HEAD> <BODY text=#000000 bgColor=#ffffff background="white"> <form target="paypal" action="https://www.paypal.com/cgi-bin/webscr" method="post"> <BR><font size=4 color="red"><B>FIRST</B></font><font size=4 color="blue"><B> - Select the Sink Model</B></font><BR><BR> <select name="item_name" onChange="pricecheck(this)"> <option value="not selected">Select a Sink</option> <option value="5050_Sink">5050 Sink</option> <option value="6040_Sink">6040 Sink</option> </select> <BR><BR><font size=4 color="red"><B>SECOND</B></font><font size=4 color="blue"><B> - Select the Color</B></font><BR><BR> <select name="item_number"> <option value="not selected">Select a Color</option> <option value="Earth_Fossil">Earth Fossil</option> <option value="Earth_Soil">Earth Soil</option> <option value="Earth_Dirt">Earth Dirt</option> </select> <BR><BR><BR> <table border="0" cellspacing="0" cellpadding="0"> <tr> <input type="image" src="https://www.paypal.com/en_US/i/btn/x-click-but22.gif" border="0" name="submit" alt="Add to Cart"> <input type="hidden" name="add" value="1"> <input type="hidden" name="cmd" value="_cart"> <input type="hidden" name="business" value="bobsmithatyahoo.com"> <input type="hidden" name=" amount "> <input type="hidden" name="no_note" value="1"> <input type="hidden" name="currency_code" value="USD"> <input type="hidden" name="lc" value="US"> <input type="hidden" name="bn" value="PP-ShopCartBF"> </td></tr> </form> </table> </BODY></HTML> I'm trying to create a page that refreshes a frame at a random interval - I've used Javascript to come up with that random interval (minimum of 5, max of 10), but the page refreshes using a meta tag in the head. I'm obviously not getting any results - help anyone? Following is the code: Code: <html> <head> <script language="JavaScript"> var now = new Date(); var secs = now.getSeconds(); var raw_random_number = Math.random(secs); var random_number = Math.round(raw_random_number * (5)+5); <meta name="GENERATOR" content="Microsoft FrontPage 5.0"> <meta name="ProgId" content="FrontPage.Editor.Document"> <meta http-equiv="Content-Type" content="text/html; charset=windows-1252"> <meta http-equiv="refresh" content="5"> </script> <title>New Page 1</title> </head> <FRAMESET COLS="*,1"> <FRAME SRC="http://htmlcodetutorial.com"> <FRAME> </FRAMESET> </HTML> So, still rather new to writing HTML. I'm looking to put either a text field or drop down box onto the page dependent on a previously defined variable. How do I go about doing that? Hello, I have a code ( see below) with a while loop that gives me a table that shows on the right side after every entry a link 'EDIT' that sends the variabe id to the script 'editjoke.php'. while ($joke = mysql_fetch_array($jokes)) { $id = $joke['id']; $joketext = htmlspecialchars($joke['joketext']); echo "<td>$joketext</td>\n"; echo "<td ><a href='editjoke.php?id=$id'>Edit</a></ td>\n"; echo "</tr>\n"; Now I created a new code with the same idea but it should have on the left side 'radio-buttons' and on the left side only one EDIT-button. Two days ago I thought it works but now it seems so that the variable is not send to editjoke.php. Here is the code: <form action="editjoke.php" method="post"> ... ... while ($num = mysql_fetch_array($number)) { //echo "<tr valign='top'>\n"; $id = $num['id']; $Auskunft = htmlspecialchars($num['Auskunft']); //echo "<td>$Auskunft</td>\n"; <input type="hidden" name="id" value="<?php echo $id; ?>" /> <input type="submit" value="SUBMIT" /> } </form> How do I have to change the code that the variable 'id' will be send to the script edithjoke.php? Hi My first post here, so I hope it's a good one! I have a form which I want a javascript function to be able to manipulate the action= line. the reason I want this is so I can manipulate the subject line. the javascript looks like this: Code: <script language="JavaScript"> function getMAILTO(){ var mailto = "andy.plumb@conwy.gov.uk?subject=EN$(FORMNO)"; alert(mailto) document.Enrolment.action = mailto; } </script> I have put the alert in so i can see what the variable produces. The form line looks like this: HTML Code: <form action="mailto:javascript:getMAILTO()" method="post" > This seems like an easy question, but what's the correct way to get user input and submit to a function? I'm able to get it to work like the following, but it doesn't seem like the 'right' way to do things: Code: <form name="some_name" action="doesnt-exist.php" onSubmit="return some_function()"><input type="text" name="query" /></form> And then I catch the variable in some_function() and return false so the page doesn't try to contact doesnt-exist.php. Then I'm able to use the input for my function. Like I said, this works, but is there a cleaner, more standard way? Thank you! Hey Team I am New to the boars this is my first html/java script code i wrote.. but it doesnt wan work could some body see wr my mistake is .. thx HTML Code: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 4.1 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>Reservation Form</title> </head> <body> <form action="res.php" method="post" name="pricecheck"> <input type="text" value="Limousine" disabled="disabled" /> <br> <table width="352" border="3" cellspacing="1" cellpadding="3"> <tr> <td><strong>Party size:</strong></td> <td> <select name="pasn" id="pasn" size="1"> <option value="0"></option> <option value="1">1</option> <option value="2">2</option> <option value="3">3</option> <option value="4">4</option> <option value="5">5</option> <option value="6">6</option> <option value="7">7</option> <option value="8">8</option> </select> </td> </tr> <tr> <td><strong> Trip Type:</strong></td> <td> <select name="tt" id="tt" size="1"> <option selected="">Select One</option> <option value="One Way">One Way</option> <option value="Round Trip">Round Trip</option> <option value="Land&Sea/Sea&Land">Land&Sea/Sea&Land</option> </select> </td> </tr> <tr> <td><strong>Transfare type</strong></td> <script type="text/javascript"> <td> if(tt="One Way") { <select name="trant1" id="trant" size="1"> <option>Select One</option> <option value="12">MCO To Disney</option> <option value="13">Disney To MCO</option> <option value="14">MCO To Cruis</option> <option value="15">Cruis To MCO</option> <option value="16">Disney To Cruis</option> </select> }else if (tt="Round Trip") { <select name="trant2" id="trant" size="1"> <option>Select One</option> <option value="17">MCO To Disney To MCO</option> <option value="18">MCO To Cruis To MCO</option> <option value="19">Disney To Cruis To Disney</option> <option value="20">Dsiney To Cruis To MCO</option> }else (tt="Land&Sea/Sea&Land") { <select name="trant3" id="trant" size="1"> <option>Select One</option> <option value="21 ">MCO To Disney to Cruis To MCO</option> <option value="22">MCO To Cruis To Dsiney to MCO</option> } </script> </td> </tr> </table> </form> </body> </html> thx again iehab ********* okay made a little changes still not work.. HTML Code: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 4.1 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>Reservation Form</title> </head> <body> <form action="res.php" method="post" name="pricecheck"> <input type="text" value="Limousine" disabled="disabled" /> <br> <table width="352" border="3" cellspacing="1" cellpadding="3"> <tr> <td><strong>Party size:</strong></td> <td> <select name="pasn" id="pasn" size="1"> <option value="0"></option> <option value="1">1</option> <option value="2">2</option> <option value="3">3</option> <option value="4">4</option> <option value="5">5</option> <option value="6">6</option> <option value="7">7</option> <option value="8">8</option> </select> </td> </tr> <tr> <td><strong> Trip Type:</strong></td> <td> <select name="tt" id="tt" size="1"> <option selected="">Select One</option> <option value="One Way">One Way</option> <option value="Round Trip">Round Trip</option> <option value="Land&Sea/Sea&Land">Land&Sea/Sea&Land</option> </select> </td> </tr> <tr> <td><strong>Transfare type</strong></td> <td> <script type="text/javascript"> var trant = array("MCO To Disney","MCO To Disney","MCO To Cruis","Cruis To MCO","Disney To Cruis","MCO To Disney To MCO","MCO To Cruis To MCO","Disney To Cruis To Disney","Dsiney To Cruis To MCO","MCO To Disney to Cruis To MCO","MCO To Cruis To Dsiney to MCO") if(tt="One Way") { for (i=0; i<=4; i++); document.write(<select name="trant[i]">tran[i]</select>); }else if (tt="Round Trip") { for (i=5; i<=8; i++); document.write(<select name="trant[i]">tran[i]</select>); }else (tt="Land&Sea/Sea&Land") { for (i=9; i<=10; i++); document.write(<select name="trant[i]">tran[i]</select>); } </script> </td> </tr> </table> <br> <input name="Submit" type="submit" value="Get Price>>" /> <input type="reset" name="Reset" id="button" value="Reset"> </form> </body> </html> |