HTML - Html Form Help - Carrying Data
Hello guys,
Not sure if this is the right board to post this one, but I need some help. I'm trying to carry over a field of numbers from one form to another. However, with the code, only some of the numbers show up. It's easier if i post the code here. Code: post.htm <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html> <head> <title>post</title> <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"/> <script type="text/javascript"> //<![CDATA[ function checkSelect() { var df=document.forms[0][0]; if(df.options[df.selectedIndex].value=='') { alert('Please enter a valid phone number'); return false; } } //]]> </script> </head> <body> <form action="post1.htm" name="Phone" enctype="multipart/form-data" method="get" onsubmit="return checkSelect()"> <Input type=text value="Phone" name="" size="20"> <input type="submit" target="blank" value="Submit"/> </form> </body> </html> and the page that the numbers should carry over to: Code: post1.htm <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html> <head> <title>post1</title> <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"/> <script type="text/javascript"> <!-- function addInfo() { document.forms[0][0].value=parent.location.search.substr(6); } onload=addInfo; //--> </script> </head> <body> <form action="#"> <input type="text"/> </form> </body> </html> Can someone please tell me what I'm doing wrong? Cheers! Similar TutorialsHi everyone I'm new to this forum and I have a question. I need to create an input form that asks users for a zip code. Once they type in their zip code and hit submit I need to take their zip code and put it in the URL. EX. if 12345 was typed, after they hit submit it would take them to "www.example.com/12345" Does this make sense? Hello, Sam here. Hope we are doing great. The sole reason i joined this forum is to learn more about HTML < Obvious. I am working on a code which requires me to convert a static html form data feeded/recorded by a user to save to a excel file. i have seen many examples of this using jscript or vbscript. Can someone walk me through this. e.g. html form contains 2 feilds name and place and a submit button. when you click submit button i want the values in the feilds say f1 and f2 to be saved to excel rows. Again i make changes to name and place and hit submit i need the same file appended with the next set of values by user. i appreciate your help. please comment on all functions or calls which saves form data to excel. I am ok with html not this stuff. Regards, Sam So I've got a form with some input text. In addition to the data in the input text I want to send some other data that has already been predetermined on initial page load. How would I declare the other data within the form element? Thanks Hi everybody! I have a jsp page with a form and a table. My aim is that when i press the submit button of the form,collect the data and fill the table with it. I am working with J2EE. I have already collected the data in a Java class,but I dont know how to introduce this data into the table. Best Regards! I have been using my site for some time now and it carries the image name over when you clicked on purchasing the print. It carries it still, but when you submit the form, the image name isnt there and the form errors because the field is blank. Here is the site: www.sthompsonphoto.com I cant seem to figure out why it disappears when you click Submit? Any help would be great! 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 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? script completed, thx Hello, wondering if someone can help me on the following: I am trying to convert a list of links over 350 collected over the years into html. The data is in text in the following format, <link title> "/" <actual http link> "/" <description> I could type each link into html but there is got to be a way to do it automatically.. since it is already formated in a text file with a clearly defined delimiter. Any ideas?? Thanks in advance for any ideas. Hi All, I've a issue in converting html file into xls,txt. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"><html> <head> <meta http-equiv="Content-Type" content="text/html;charset=utf-8"> <title>Data</title> <script type="text/javascript" src="sorttable.js"></script> <style type="text/css"> a.hidecolumn { cursor:pointer; text-decoration:none; font-weight:lighter; } a:hover.hidecolumn { color:red; } table.sortable a.sortheader { background-color:#e0e0e0; color:#666666; font-weight: bold; text-decoration: none; display: block; } table.sortable th {background-color:#e0e0e0;} table.sortable span.sortarrow { color: black; text-decoration: none; } </style></head> <body> <H1>Checks</H1> <H2> Checks</H2><table id="Checks" border="1" cellpadding="2" cellspacing="0" class="sortable"><tr class="sortheaderrow"><td valign="top" align="left">Table name</td><td valign="top" align="left">Check name</td><td valign="top" align="left">Description</td><td valign="top" align="left">SQLString</td></tr> <tr> <td><a href="party_0-length _1.html">SELECT COUNT(*) FROM (SELECT 1 as one FROM party WHERE LENGTH(ID) = 0 OR LENGTH(NUMBER) = 0 OR...</a></td> </tr> If you see the line href="party_0-length _1.html">SELECT COUNT(*) FROM (SELECT 1 as one FROM party WHERE LENGTH(ID) = 0 OR LENGTH(NUMBER) = 0 OR... It has a part of the data prefixed with the href. If I click the href I can get the complete data. When I tried to convert the data to XLS I'm getting the truncated data. Please help me This is what I need: User opens HTML file---->data from XML file is displayed in order in HTML file This is my problem: User opens HTML file----> Only the heading "current log" and "tstamp" and "entry" are displayed I took the HTML and SXL from http://www.w3schools.com/xsl/xsl_client.asp HTML: Code: <html> <body> <script type="text/javascript">// Load XML var xml = new ActiveXObject("Microsoft.XMLDOM") xml.async = false xml.load("CurrentLog.xml")// Load XSL var xsl = new ActiveXObject("Microsoft.XMLDOM") xsl.async = false xsl.load("CurrentLog.xsl")// Transform document.write(xml.transformNode(xsl)) </script> </body> </html> XML: Code: <?xml version="1.0" standalone="yes" ?> - <IncrepDataset xmlns="http://tempuri.org/IncrepDataset.xsd"> - <Control> <Control_ID>0</Control_ID> <Name>DocViewer</Name> <Filename>docviewer.dll</Filename> <Icon>doc</Icon> <IncrepLoadable>true</IncrepLoadable> <Version>4.0.0.28546</Version> <TStamp>2006-11-06T18:00:09.4160070-06:00</TStamp> </Control> - <Control> <Control_ID>-1</Control_ID> <Name>RIDS</Name> <Filename>ridswrapper.dll</Filename> <Icon>tool</Icon> <IncrepLoadable>true</IncrepLoadable> <Version>4.0.0.28559</Version> <TStamp>2006-11-06T18:00:32.8518090-06:00</TStamp> </Control> - <Control> <Control_ID>-2</Control_ID> <Name>Explosives</Name> <Filename>atfwrapper.dll</Filename> <Icon>tool_bomb</Icon> <IncrepLoadable>true</IncrepLoadable> <Version>4.0.0.28559</Version> <TStamp>2006-11-06T18:01:01.2952610-06:00</TStamp> </Control> - <Control> <Control_ID>-3</Control_ID> <Name>ChecklistViewer.Bomb Response</Name> <Filename>checklistwrapper.dll</Filename> <Icon>tool_checklist</Icon> <IncrepLoadable>false</IncrepLoadable> <Version>4.0.0.28559</Version> <TStamp>2006-11-06T18:01:21.5461976-06:00</TStamp> </Control> - <DataType> <Datatype_id>1</Datatype_id> <name>String</name> <description /> </DataType> - <IncidentLog> <IncidentLog_ID>-10</IncidentLog_ID> <TStamp>2006-11-06T18:01:26.7541536-06:00</TStamp> <Entry>- 'COMMENCE IED SOP/ERG ACTIONS. GATHER ALL INFO.' checked</Entry> <AddedByUser>false</AddedByUser> <submission_id>0</submission_id> <Priority>Low</Priority> <Control_ID>-3</Control_ID> </IncidentLog> - <IncidentLog> <IncidentLog_ID>-11</IncidentLog_ID> <TStamp>2006-11-06T18:01:26.8142454-06:00</TStamp> <Entry>- 'SET INITIAL EXCLUSION AREA.' checked</Entry> <AddedByUser>false</AddedByUser> <submission_id>0</submission_id> <Priority>Low</Priority> <Control_ID>-3</Control_ID> </IncidentLog> - <IncidentLog> <IncidentLog_ID>-12</IncidentLog_ID> <TStamp>2006-11-06T18:01:26.8943678-06:00</TStamp> <Entry>- 'MAKE ALL NOTIFICATIONS.' checked</Entry> <AddedByUser>false</AddedByUser> <submission_id>0</submission_id> <Priority>Low</Priority> <Control_ID>-3</Control_ID> </IncidentLog> - <IncidentLog> <IncidentLog_ID>-13</IncidentLog_ID> <TStamp>2006-11-06T18:01:26.9644749-06:00</TStamp> <Entry>- 'IDENTIFY ON-SCENE COMMAND (OSC)/ COMMAND POST (CP) LOCATION.' checked</Entry> <AddedByUser>false</AddedByUser> <submission_id>0</submission_id> <Priority>Low</Priority> <Control_ID>-3</Control_ID> </IncidentLog> - <IncidentLog> <IncidentLog_ID>-14</IncidentLog_ID> <TStamp>2006-11-06T18:01:38.6222841-06:00</TStamp> <Entry>Incident Summary selected</Entry> <AddedByUser>false</AddedByUser> <submission_id>0</submission_id> <Priority>Low</Priority> </IncidentLog> </IncrepDataset> XSL: Code: <?xml version="1.0" encoding="ISO-8859-1"?> <!-- Edited with XML Spy v2006 (http://www.altova.com) --> <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> <xsl:output method='html' version='1.0' encoding='UTF-8' indent='yes'/> <xsl:template match="/"> <html> <body> <h2>Current Log</h2> <table border="1"> <tr bgcolor="#9acd32"> <th align="left">TStamp</th> <th align="left">Entry</th> </tr> <xsl:for-each select="tstamp/entry"> <tr> <td><xsl:value-of select="TStamp"/></td> <td><xsl:value-of select="Entry"/></td> </tr> </xsl:for-each> </table> </body> </html> </xsl:template> </xsl:stylesheet> I have two other versions of the HTML file that don't require XSL but they only half work. One displays everything I want but not in the right order the other displays in the right order but only displays the first TStamp and Entry. Hi, I have a situation where I have to transfer some data (from a text area in the first page, on submit) to the second page. Both the pages should be strictly in HTML. Is there any way to do it? I understand that we cannot receive any data from a Form unless we use a server side language. I am a newbie to HTML.. and would greatly appreciate any help.. Thanks! Hello all! I've been lurking in these forums for a good while as I've recently started dabbling in web design. As such, I find myself stumped. Despite my relatively thorough search on Google I've yet to find anything that points me in the right direction. I assume I'm simply not using the right terminology in my searches. Hopefully the community here can help me out. In short I have a chat applet that I'm trying to get a "Report Member" function working in. Users can right click on a member and select "Report Member". From there I have a page on my site called Report.htm and that particular URL. The chat applet provides information on the end of that URL. Here is an example URL: Code: http://www.siteurl.com/report.htm?username=JohnDoe&roomname=Main+Room&showuser=2264826&uid=2264826&srcuid=2264826&srcusername=JaneDoe Essentially, JaneDoe is reporting JohnDoe for who knows what. When the report is made they're sent to the placeholder report page with all the details at the end of the URL. If possible, I'd like the Report.htm page to have a form in it where the information for the form is prefilled (and uneditable) from the information provided by the URL. Essentially the form would roughly look like the following: Username of Member: JohnDoe Your Username: JaneDoe Room: Main Room Report: (This would be the only editable section) After filling out the report they'd hit submit and it'd get emailed to the moderating staff. Is this something handled on the server side of things? If so I've potentially posted this in the wrong subforum, but I assumed it was something that could be done via form tags in HTML (though I do know some script would be needed for the actual submission of the form). My server uses PHP, if that information is useful. With all that said, is this possible? If so, what can help get me started in learning how to do this? I've spent a good deal of time looking around on Google but nothing seems to be quite what I want or, more likely, I'm simply not using the right search terms. Any help would be greatly appreciated! Hello I have some preexisiting html pages in which I want to populate some tags with data read from an xml file. ..What is the best pssible way to do so? The data changes every week. I am OK with running a javascript which imports the xml data into html and then just use those static html pages. But how will this work? I am new to this client side stuff and hence the questions. Any pointers will be greatly appreciated. Thx Hi My problems: Q1: I am getting data from mySQL to populate fields to generate a report in html. The report are in two pages. Sometimes page two comes into page one. is there a way we can force page two to be only in page two. Q2: If I am printing only 1 page report, is there a way to force print (without changing print setting to print) into one page. Thanks Siva 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 had created a form using html.Can i collect all the data tht key in by the user at the form to .txt file? can ths be done by php or html? Can u please guide me step-by-step? Thanks in advance. 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, i have a form wich consist username and password. i want to read these content and store in the local system( my system) also i want to read the same thing from the file. can any one please send me the code for that. Many thanks in advance... Hey all, This is probably a stupid question, but it's driving me nuts - I have a simple form with 2x file uploads on it, and when the user clicks a button a PHP script is run. This scrip is picked up by checking the global $_POST variable for 'upload'. This works fine and my PHP script does the upload when I only select one file (using either one), but when both are filled in for some reason the global $_POST variable is empty, so my script will not run. Before looking down the PHP route I'm wondering if everything is ok with my form, or if there is some error that I am missing that is causing this problem? Any help is greatly appciated. Thanks. Code: <form action="" method="post" name="client-balances-selection" enctype="multipart/form-data"> <div id="current-balances"> <h3>Current client balances</h3> <input type="file" name="current_balances" class="file_upload" /> </div> <div id="past-balances"> <h3>Past client balances</h3> <input type="file" name="past_balances" class="file_upload" /> </div> <input type="submit" name="upload" class="button-primary" value=<?php _e('Compare'); ?> /> <input type="submit" name="delete" class="button-delete" value=<?php _e('Delete old files'); ?> /> </form> |