HTML - Passing Form Textbox Values?
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.
Similar TutorialsHi 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. Hi all, how do i go about making my html form textbox borderless like the one in this picture? I want to make my form a bit better looking, so any links to customising them would be good. Hi, I have a form designed to take details of a customer; I want to have the details of a form display in it's own textbox so i can use some javascript to 'Ctrl+A' and 'Ctrl+C' it. This code I have already, but getting the info from the 'form' into the text box is the issue. Another thing I should mention, this will be stored locally on a machine, there's no web servers. It's purely a web-based app for someone to put into while they're taking a call for a problem. any idea's, here's the code on my page thus far: <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <HTML> <HEAD> <link rel="stylesheet" type="text/css" href="main.css" /> </HEAD> <BODY> <script type="text/javascript" language="JavaScript"> function HidePart(d) { document.getElementById(d).style.display = "none"; } function ShowPart(d) { document.getElementById(d).style.display = "block"; } function CheckboxChecked(b,d) { if(b) { ShowPart(d); } else { HidePart(d); } } </script> <Table class="one" name="main_Body" align ="left" border="0" width 100%> <FORM name="MNTA" action="data.html" method="post"> <tr> <td height="26"> First Name </td> <td> <input type="text" name="firstname"> </td> </tr> <tr> <td height="26"> Last Name </td> <td> <input type="text" name="lastname"> </td> </tr> <tr> <td height="26"> Company </td> <td> <input type="text" name="company"> </td> </tr> <tr> <td height="26"> Contact Number </td> <td> <input type="text" name="contact"> </td> </tr> <tr> <td height="26"> eMail Address </td> <td> <input type="text" name="email"> </td> </tr> <tr> <td height="26"> Does User have a Maximo ID? <input type="checkbox" name="MAXID" value="yes" onclick="CheckboxChecked(this.checked,'MaxIDdiv')"> Yes <br> </td> <td> <div id="MaxIDdiv" style="display:none"> Users Maximo ID <input type="text"> </div> </td> </tr> <tr> <td height="26"> Is this an existing request? <input type="checkbox" name="MN_No" value="yes" onclick="CheckboxChecked(this.checked,'MN_Nodiv')"> Yes <br> </td> <td> <div id="MN_Nodiv" style="display:none"> ManageNow Incident Number <input type="text"> </div> </td> <tr> <td height="26"> Has a Local SME advised to raise this request? </td> <td> <input type="radio" name="LSME" value="Yes"> Yes <input type="radio" name="LSME" value="No"> No <input type="radio" name="LSME" value="NA"> Not Applicable </td> </tr> <tr> <td height="26"> Are other users experiencing the same problem? </td> <td> <input type="radio" name="OUse" value="Yes"> Yes <input type="radio" name="OUse" value="No"> No <input type="radio" name="OUse" value="NA"> Not Applicable </td> </tr> <tr> <td height="26"> Can the user log into Maximo? </td> <td> <input type="radio" name="LMAX" value="Yes"> Yes <input type="radio" name="LMAX" value="No"> No <input type="radio" name="LMAX" value="NA"> Cannot access site </td> </tr> <tr> <td height="26">Does the user have the same issue on another machine? </td> <td> <input type="radio" name="NLMI" value="Yes"> Yes <input type="radio" name="NLMI" value="No"> No <input type="radio" name="NLMI" value="NA"> Not Applicable </td> <tr> <td> <input type="submit" value="Submit" /> </td> </tr> </table> </FORM> </H1> </body> </html> I won't bother to link my CSS it's very basic. my main.html (<FORM name="MNTA" action="data.html" method="post">) page exists but doesn't have any code. I don't mind if I have to have the data populated on another page that's fine. I also don't mind using JS and the site will only be viewed in IE 6. Thanks in advance, I can't find anything and beleive me I've spent hours trying. 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 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 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. 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? 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- 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> 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 ? 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" > Hello i want to get values passed from a webpage lets say siteA.html from another page siteB.html without php jsp or any server side language just html and javascript. If you can give an example on how to do this or an overview please do it. Thanks. Hey guys. I've been using local storage for my form and so far it's worked great. Most of the form is simply having the user type in an answer but I have 4 questions that need to be as radio buttons. The problem is I need these radio buttons to be calculative values. I'm pretty sure I've got the 'setting values' part down but how do I 'set item' and 'get item' using local storage? Thanks in advance! Here's what I'm using: HTML Code: <input type="radio" name="length" value=".106" /> Less than 1 year<br /> <input type="radio" name="length" value="0" /> 1-2 years<br /> <input type="radio" name="length" value="-.053" /> More than 2 years<br /> HTML Code: localStorage.setItem("length", this.elements["length"].value); HTML Code: localStorage.getItem("length") I can figure the rest of my problem out myself, but this one is really getting to me. In a form, I have to have certain radio buttons, or a select box pass a link into the SQL. The problem I am having is this code: Code: ... value="<img src="http:... ">" doesn't work. I have tried changing it to look like this: Code: value="/<img src=/"http:...../"/>" which still doesn't work. So how can I have a select box or radio buttons that when I choose a picture, it will pass that pictures html link to the next phase? How do I write it out? Could someone be specific please? If you don't understand, tell me what you're not getting and I will try and explain a bit better. Hi I have a web form that, on submission populates a mySQL database through PHP. Each question on the form can have up to 5 different answers. What I am trying to achieve, either through radio groups or drop-down menus is to have unique values for each number so effectively ranking them. Example: Rank your favourite colours from these: Red [1][2][3][4][5] Blue [1][2][3][4][5] Green [1][2][3][4][5] White [1][2][3][4][5] Orange [1][2][3][4][5] Now for each one, I only want the user to select a UNIQUE value so that the same two numbers cannot be submitted. On submission there must be a 1,2,3,4 & 5 (ie with no two questions having the same number) Scratching my head on this one. Any help would be most welcome. Thanks did not realize this was also javascript too. Please help me on this one. http://www.htmlforums.com/php-progra...eld-87724.html how to make the page automatically grab the page's url and paste it into a textfield. thanks Hi, I am trying to work out a form i.e. user was to choose from a "Yes/No" drop-down option. For example if user was to choose "NO", nothing will happen, BUT if user was to choose "YES" option, a text box will appear next to the field to allow user to enter some information. Can this be done? My code is below. Thanks HTML Code: <tr> <td bgcolor="#eeeeff"> Is it a shared device?<br> <font color='#F62817'>** If yes, please indicate the shared device </font> </td> <td bgcolor="#eeeeff"> <SELECT name="shared"> <option value="No"SELECTED>No</option> <option value="Yes">Yes</option> <INPUT type = "TEXT" name = "shared_remark" value = "NIL"> </td></tr> Right...I'm in the process of creating a sample website, which takes in date data and number data...and I was wondering...as I have the option of using drop downs or textboxes....if the site does go onto a server...would it be easier (as the developer) to use drop downs or text inboxes..? I mean..when it comes to the user choosing things using the drop down or inputting into the textbox..and sending it to search in a database...which would be easier to play around with..and less complicated..? *thinks Am I making sense?* Alright, I have a DIV with this as the background image: I put two textboxes over them, the first one is aligned ok but the second one is too high. How do I space them out? When I try br it goes down way too far. Here is what it looks like right now: Should I use a table? more DIVs? Or, is there a css code I could use to bring it down? |