HTML - Url Variable Sent Via Form?
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. Similar TutorialsI 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? 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 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 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!!! 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" > script completed, thx Hi all, I have a simple newsletter form, so just the email field and a submit, what I would like to do is to send this data to a larger subscriber form, so one that has name, email (with the data previously entered already added), list to subscribe to etc. Can this be done? Thanks I have a form with a number of elements. One of these elements is: <input type="image" src="https://www.paypal.com/en_US/i/btn/x-click-butcc-subscribe.gif" border="0" name="submit" alt="Make payments with PayPal - it's fast, free and secure!"> Clicking on that element makes the form submit. But if I add a similar element: <input type="image" src="https://www.paypal.com/en_US/i/btn/x-click-butcc-subscribe.gif" border="0" name="submit2" alt="Make payments with PayPal - it's fast, free and secure!"> ...clicking on that also makes the form submit. So was wondering if anyone knew what the rules were for which elements make a form submit? Cheers, James Hello, I am going to make an Iframe. The URL that shows inside the Iframe has to change with the click of a button. So as defult, it displays www.1.com when i click on the button '2' on the webpage (not inside the iframe) the Iframe then displays www.2.com the same for buttons 3 4 5 etc. how can i do this? i was thinking of having the URL the iframe goes to as a variable, and changing the variable each time i click on one of the buttons? Help please ^_^ thanks. I'm new to all this stuff, but I am working on creating a simple drop-down menu that must pass a variable to an xml script (VXML to be exact). All files will be on a linux web host. Any suggestions on what to use for the drop-down menu web page (php, java script, etc)? Depending on what selection is chosen in the drop down, a different value need to be assigned to the variable. Thanks! Hi, I can't get the variable E to print at the end by the form answer. It is calculating cubic inches, then the Answer is to gallons. I want to see both answers. Thanks in advance!! Code follows: <HTML> <HEAD> <TITLE>Calculation</TITLE> <SCRIPT LANGUAGE="JavaScript"> function CalculateSum(Atext, Btext, Ctext, Dtext, form) { var A = parseFloat(Atext); var B = parseFloat(Btext); var C = parseFloat(Ctext); var D = parseFloat(Dtext); var E = (A*C*D) + ((A/2) * (B-C)*D); form.Answer.value = E/200 ; } /* ClearForm: this function has 1 argument: form. It clears the input and answer fields on the form. It needs to know the names of the INPUT elements in order to do this. */ function ClearForm(form) { form.input_A.value = ""; form.input_B.value = ""; form.input_C.value = ""; form.input_D.value = ""; form.input_E.value = ""; form.Answer.value = ""; } // end of JavaScript functions --> </SCRIPT> </HEAD> <BODY> <P><FONT SIZE="+2">Calculation</FONT></P> <FORM NAME="Calculator" METHOD="post"> <P>Enter A: <INPUT TYPE=TEXT NAME="input_A" SIZE=10></P> <P>Enter B: <INPUT TYPE=TEXT NAME="input_B" SIZE=10></P> <P>Enter C: <INPUT TYPE=TEXT NAME="input_C" SIZE=10></P> <P>Enter D: <INPUT TYPE=TEXT NAME="input_D" SIZE=10></P> <P><INPUT TYPE="button" VALUE="CALCULATE" name="AddButton" onClick="CalculateSum(this.form.input_A.value, this.form.input_B.value, this.form.input_C.value, this.form.input_D.value, this.form )"></P> <P><INPUT TYPE="button" VALUE="Clear Fields" name="ClearButton" onClick="ClearForm(this.form)"></P> <P>Cubic Inches = <script type="text/javascript"> document.write(E); </script> <br> Gallons =<INPUT TYPE=TEXT NAME="Answer" SIZE=12> </P> </FORM> </BODY> </HTML> At this moment I am making a 'website' which shows embedded docx, doc, pfd, ppt or pptx files, using the google docs viewer. This works great, but of course I have a problem. The files on the server have one NONE variable part in the name, and the other parts are variable. So an example: firstfile_001.pdf firstfile_001.docx first_001_abc.pptx So the files can have 3 variable parts in it: *_001_*.* But only one of the files is present. So if there is a 001_*.pdf, there is no 001_*.doc. Is there a way to adobt to this variable urls? (PHP is not an option because it is not supported by the server. I cannot change anything on the server (i.e., get an other server or so.)) HTML Code: <form method="post" action="mailto:xxxxxxxx@xx.com "> <table class="text3"> <tr><td valign="top" width="140">Voornaam:</td><td><input name="requiredvoornaam" type="text" id="requiredvoornaam" class="veld" size="30" /></td></tr> <tr><td valign="top" width="140">Achternaam:</td><td><input name="requiredachternaam" type="text" id="requiredachternaam" class="veld" size="30" /></td></tr> <tr><td valign="top">E-mail:</td><td><input name="requiredemail" type="text" id="requiredemail" class="veld" size="30" /></td></tr> <tr><td valign="top">Telefoonnummer:</td><td><input name="requiredtelefoonnummer" type="text" id="requiredtelefoonnummer" class="veld" size="30" /></td></tr> <tr><td valign="top">Adres:</td><td><input name="requiredadres" type="text" id="requiredadres" class="veld" size="30" /></td></tr> <tr><td valign="top">Woonplaats:</td><td><input name="requiredwoonplaats" type="text" id="requiredwoonplaats" class="veld" size="30" /></td></tr> <tr><td valign="top">Aankomstdatum:</td><td><select name="adag" id="adag"> <option value="Dag">Dag</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> <option value="9">9</option> <option value="10">10</option> <option value="11">11</option> <option value="12">12</option> <option value="13">13</option> <option value="14">14</option> <option value="15">15</option> <option value="16">16</option> <option value="17">17</option> <option value="18">18</option> <option value="19">19</option> <option value="20">20</option> <option value="21">21</option> <option value="22">22</option> <option value="23">23</option> <option value="24">24</option> <option value="25">25</option> <option value="26">26</option> <option value="27">27</option> <option value="28">28</option> <option value="29">29</option> <option value="30">30</option> <option value="31">31</option> </select> <select name="amaand" id="amaand"> <option value="Maand">Maand</option> <option value="Januari">Januari</option> <option value="Februari">Februari</option> <option value="Maart">Maart</option> <option value="April">April</option> <option value="Mei">Mei</option> <option value="Juni">Juni</option> <option value="Juli">Juli</option> <option value="Augustus">Augustus</option> <option value="September">September</option> <option value="Oktober">Oktober</option> <option value="November">November</option> <option value="December">December</option> </select> <select name="ajaar" id="ajaar"> <option value="Jaar">Jaar</option> <option value="2008">2008</option> <option value="2009">2009</option> <option value="2010">2010</option> </select> </td></tr> <tr><td valign="top">Vertrekdatum:</td><td><select name="vdag" id="vdag"> <option value="Dag">Dag</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> <option value="9">9</option> <option value="10">10</option> <option value="11">11</option> <option value="12">12</option> <option value="13">13</option> <option value="14">14</option> <option value="15">15</option> <option value="16">16</option> <option value="17">17</option> <option value="18">18</option> <option value="19">19</option> <option value="20">20</option> <option value="21">21</option> <option value="22">22</option> <option value="23">23</option> <option value="24">24</option> <option value="25">25</option> <option value="26">26</option> <option value="27">27</option> <option value="28">28</option> <option value="29">29</option> <option value="30">30</option> <option value="31">31</option> </select> <select name="vmaand" id="vmaand"> <option value="Maand">Maand</option> <option value="Januari">Januari</option> <option value="Februari">Februari</option> <option value="Maart">Maart</option> <option value="April">April</option> <option value="Mei">Mei</option> <option value="Juni">Juni</option> <option value="Juli">Juli</option> <option value="Augustus">Augustus</option> <option value="September">September</option> <option value="Oktober">Oktober</option> <option value="November">November</option> <option value="December">December</option> </select> <select name="vjaar" id="vjaar"> <option value="Jaar">Jaar</option> <option value="2008">2008</option> <option value="2009">2009</option> <option value="2010">2010</option> </select> </td></tr> <tr><td valign="top">Welke huisje:</td><td><select name="huisje" id="huisje"> <option value="1">.____Huisje Zomerbries_____.</option> <option value="2">.____Huisje Wervelwind_____.</option> <option value="3">.____Huisje Tornado________.</option> </select> <tr><td valign="top">Aantal personen:</td><td><select name="aantal personen" id="aantal personen"> <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> <tr><td valign="top">Overige vragen:</td><td><textarea name="bericht" rows="6" cols="23" id="bericht" class="area"></textarea></td></tr> <tr><td valign="top"></td><td><input type="submit" name="sendFormButton" value="Verzenden" id="sendFormButton" /></td> </tr> </table> </form> </td></tr></table> This is what i get once tested... its out of order... Help me plz...... Im not good with those thingz.. I have a simple signup form on my site that I want to pass the input to the larger signup form. Here is the code for the simple form: <form action="http://bigdogcattle.com/?a=Cattle_Mailing-List_SignUp" method="post" accept-charset="UTF-8"> The larger signup form is located he http://bigdogcattle.com/?a=Cattle_Mailing-List_SignUp I want the email address from the simple form to move to the larger form when the submit button is pressed. Ideas? Hi! I would like to know how do I pass a variable in my URL to the next page. HTML Code: For example, my URL is: http://www.mysite.com?source=google I'm using this form code to go to the next page: <form action="http://www.mysite.com/next-page.html" method="get" name="form"> <input type="text" name="zipcode" maxlength="5" id="zipcode" /> <br /> <input type="submit" id="button" value="Go"/> </form> So the next page URL will be: http://www.mysite.com/next-page.html?zipcode=11111 I want that the variable "google" will be also in this URL: http://www.mysite.com/next-page.html?zipcode=11111&source=google How I do that? Thanks, Steve I have tried to use a variable in mailto: in order to protect my email address from spammers. Am I doing something wrong or is it simply not possible? $info="my@email.com"; /*email address is stored in email.inc and is moved to the script with the include() statement.*/ $recipients = '$info'; Hi Can someone help or advise me I am after a piece of code that will show a search box, which will display two different results depending on what is entered into the search. If someone was to enter one of my selected keywords a successful message appears. But if any other word is enter a nun-successful message appears. I think what i am after is some kind of "form"?? but have search lots of sites with little success. The search does Not need to email or add information to any files, just dispaly a succsessfull or un-successful message result. thanks Can the initial value of a text field be a variable described by javascript? If so, please tell me how. 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> |