HTML - Passing A Variable To Form Inout
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> Similar TutorialsHi 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 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" > 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 all, i'm new to xml but i was wondering if the following is possible: I have a html document with some tabs. And when i click on a tab it opens a xml document. In the xml document is a link to xsl sheet with a variable and i want to change that variable with the value of the link in html document. Does some one nows how? html link: <a href="#t1" target= "t1" title="[link title]">11</a> <div class="sliderkit-news" id=t1><iframe name="t1" width="100%" height="800" src=wo.xml></iframe> xml variable <xsl:variable name= "line" select="'11'"/> The number 11 should come form the a href in the html doc. Also the following is possible fill the variable with a drop down menu: <xsl:variable name= "line"> <select> <option value="'11'">11</option> <option value="'12'">12</option> <option value="'13'">13</option> </select> </xsl:variable> I want to fill the variable with a drop down selection. and then use the variable in the document. What i do is opening the xml en then it generates a display based on the xsl sheet. i hope some one can help me. 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? Hi, am trying to show a page in a HTML <iframe> but before loading that page I want to set a variable value. I tried following: <iframe src="slgrid/ccustomer.php?id=" <? echo $cat; ?> "width="100%" height="100""></iframe> but can not get the value of id using $_GET['id'] Any other ideas are also welcome please. I am a little new in PHP and HTML. Any help in this regard will be appreciated. Thanks and regards, 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? 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? Ok, this sounds extremely easy but I'm more of a designer and less of a coder. I'll try and explain what I want to accomplish. I spent the better part of the afternoon yesterday searching for a solution. Alas, I need some assistance! We have a page where users can view a report in a PDF format from a drop down. Also on that page we need to have a place where they can select an option from a drop down and email the PDF to them. Now, we have the link set up. I can take a sample link, add my email address to the end of it, hit enter and it shoots me an email. The question is how can I take what the user inputs into a form and pass it into a URL. All that needs to happen is to send the user to that URL and have the URL be correct. At that point the email gets sent automatically. My best attempt so far gets me to the URL but things like &, =, etc are replaced by %3D and %26. The URL won't work that way. I'll post that code: Code: <FORM METHOD="LINK" ACTION="https://fusion.bennettware.com:4443/drivers/getfueltaxreport?"> <select name="unitfuel"> <option selected>Select Month</option> <option value="year=09&month=01&reportName=UnitTax">January 2009 </option> <option value="year=09&month=02&reportName=UnitTax">February 2009</option> </select> Type in your email address: <INPUT TYPE="text" NAME="&email="> <INPUT TYPE="submit" VALUE="Send email"> </FORM> Here is what I get in the URL: (sorry had to place it in html tags because the link was only half showing up.) HTML Code: https://fusion.bennettware.com:4443/drivers/getfueltaxreport?unitfuel=year%3D09%26month%3D01%26reportName%3DUnitTax&%26email%3D=test@testmail.com Also, notice that "unitfuel" gets appended to the URL as well. It gets passed into the URL and that will likely cause the report to fail. The URL needs to look like this: HTML Code: https://fusion.bennettware.com:4443/drivers/getfueltaxreport?year=09&month=01&reportName=UnitTax&email=myemail@mydomain.com If a user were logged in and ran that link, a page would appear stating that an email had been sent. So, all I need it for the input to get placed into the URL without all of the additional characters. The report cannot run when the URL looks like the above and thus cannot get emailed. Also, that link probably won't work since the site is password protected, so you'll likely get a 'page cannot be displayed' error if you try to access it. Solution is likely simple, then again, my luck would have it not being so simple! I thank you all in advance for your help. At least a point in the right direction would be nice. Hi This is my first post so trust I don't breach any protocols. I'm creating a form that will send data from the form to an email. I have done this many times before with no problem but suddenly it is failing to do so. The main form has approx24 data fields so in case this was a problem, created a simple form with 2 text fields and a submit button but this wouldn't work either. My default Editor is dreamweaver MX and outlook as my email. Not being sure if it is my code, editor or email system causing the problem I have tried all variations using Dreamweaver MX, Dreamweaver CS3, Frontpage and in desperation Pagebreeze with Outlook, Outlook Express and Mozilla Thunderbird. I'm pulling my hair out. Code: <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <title>Untitled Document</title> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> </head> <body> <form action="mailto:My Email address" method="post" name="form1"> <p> <input type="text" name="textfield"> </p> <p> <input type="text" name="textfield2"> </p> <p> <input type="submit" name="Submit" value="Submit"> </p> </form> </body> </html> Has anyone had the same problem and solved it ? I wish to get the value of a textbox in a form however, I'm unable to reference the textbox using the name property (I wish to get both the name and value property values). Is there another way to get these properties values? Or pass them as parameters through an onClick event as I'm trying to retrieve these within another javascript function. 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- 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. 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? 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? hello experts , i have a small problem i wrote these two inputs as hidden "total" is a integer value , set previously & "username" is a string , set previously . but when i am passing it and retrieving it i am getting the values as "total" & "username" , not 15 and 'kane' which i have set before. in short the values are not being passed to the form. Code: <INPUT TYPE='hidden' NAME='total' VALUE='total'>"); <INPUT TYPE='hidden' NAME='username' VALUE='username'> kane Hi all, Please could someone help this n00b Im a am using html <form> and radio buttons for users to select values. I have 3 pages. The user selects a value on the first page, is then directed to the 2nd page, where they choose another value. Is it then possible to display both these values on the 3rd page. I would like to do this without using javascript. I have a site (no standards, written with MS Frontpage) that I am converting to 4.01 strict with Dreamweaver. There is one big problem ... virtually all of the text in 4.01 strict is spread out vertically, especially when they are in separate paragraphs: Code: <p class="nomargin" align="center>New to stewardship?</p> <p class="nomargin" align="center>Start here!</p> where the "nomargin" class is: Code: .nomargin { margin: 0px 0px 0px 0px; padding: 0px 0px 0px 0px; } These two sentences are close together vertically in either the MS quirky, or 4.01 transitional standard, but there is significant vertical margin (they are spread out vertically) under 4.01 strict. I need to use 4.01 strict, but I also need these paragraphs to have no margin so they are close together vertically. Why does 4.10 strict do this and how do I eliminate the margins? Thanks |