HTML - Split Form Field
Hello,
I have a form which is used to pass a password in 2 factor authentation. What I am looking to do is to take : <input class=CTXMSAM_ContentFont type="Password" title="Enter password" name="passwd1" size="13" maxlength="32"> and split it into two form fields but when the user submits the form combining both fields to be submitted wth the name="passwd1" This is crutial for authentication to work. The reason for this is that the password is a secure token which contain a PIN + Tokencode. Currently the need to put both in one field and hit submit combining it them selves. This is not optimal as end users are not the smartest eggs out there. Thanks The full .js script is below: var loginPrefilled = false; function SetCookie(cookieName,cookieValue) { var today = new Date(); var expire = new Date(); expire.setTime(today.getTime() + 3600000*24); document.cookie = cookieName+"="+escape(cookieValue)+";path=/;expires="+expire.toGMTString(); } function UnsetCookie(cookieName) { document.cookie=cookieName+"=nothing;expires=Thursday, 1 Jan 1970 00:00:00 GMT; path=/"; } function ns_check() { var login=document.forms['vpnForm'].login.value; if(login == "") {window.alert("You need to enter login name"); return false; } SetCookie("NSC_USER", login); return true; } function ns_disperrmsg() { if(document.cookie.length>0) { if(document.cookie.indexOf("NSC_VPNERR=4001") != -1) { document.writeln("<FONT COLOR=#000000><B><CENTER> Invalid username or password.</CENTER></B></FONT>"); UnsetCookie("NSC_VPNERR"); return; } } document.writeln(" "); } UnsetCookie("NSC_AAAC"); UnsetCookie("NSC_USER"); function ns_getcookie(name) { var cookie=document.cookie; if(cookie.length > 0) { begin=cookie.indexOf(name+"="); if(begin!=-1) { begin+=name.length+1; end=cookie.indexOf(";", begin); if(end==-1) end=cookie.length; return unescape(cookie.substring(begin, end)); } } return null; } function ns_fillName() { var value=ns_getcookie("NSC_NAME"); document.vpnForm.login.focus(); if(value!=null) { document.vpnForm.login.value = value; loginPrefilled = true; document.vpnForm.login.style.color = "#777"; document.vpnForm.passwd.focus(); UnsetCookie("NSC_NAME"); } } function loginFieldCheck() { if(loginPrefilled == true) { document.vpnForm.login.blur(); } } function ns_showpwd() { var pwc = ns_getcookie("pwcount"); document.write('<TR><TD align=right><SPAN class=CTXMSAM_ContentFont style="FONT-WEIGHT: bold">Windows Password'); document.write(':</SPAN></TD>'); document.write('<TD><input class=CTXMSAM_ContentFont type="Password" title="Enter password" name="passwd" size="13" maxlength="32"></TD></TR>'); if ( pwc == 2 ) { document.write('<TR><TD align=right> <SPAN class=CTXMSAM_ContentFont style="FONT-WEIGHT: bold">SecurID PASSCODE:</SPAN> </TD> <TD> <input class=CTXMSAM_ContentFont type="Password" title="Enter password" name="passwd1" size="13" maxlength="32"> </TD></TR>'); } UnsetCookie("pwcount"); } Similar Tutorialsok im new go easy. im trying to make a site and i need the user to post a url into a form input field say .. PIC . this is a standard input field. now ... i want to display a pic using <img> and then instead of a "www.blah blah" hardwired , i want to use the string the user entered instead. any ideas? thanks do much I'm relatively new to html, specifically I have never programmed a web form before. My submit page (It's an archive-style site where I encourage people to submit their own stories) seems to have multiple problems, including he simple fact that it doesn't seem to display properly. My main issue, and the one I'm asking about here, is that people keep submitting blank forms and I want to make it so the STORY field is required. Sorry that the code is a mess, but as I said I'm pretty new to this. Thanks for any help you can provide. Code: <html><head> <meta http-equiv="content-type" content="text/html; charset=ISO-8859-1"> <title>Archive Poster</title> </head> <body text="#ffffff" vlink="#FF0000" alink="#FF0099" bgcolor="#000000"><style type="text/css"><!--A {text-decoration: none} .style1 { border-left-style: solid; border-left-width: 1px; border-right: 1px solid #FFFFFF; border-top-style: solid; border-top-width: 1px; border-bottom: 1px solid #FFFFFF; } --> </style> <center><table width="600" cellpadding="0" cellspacing="0" class="style1"> <tbody><tr> <td valign="CENTER" width="600" align="left"> <br><blockquote><hr><hr> <font size="6" color="#ffffff" face="ARIAL"><b>Post Your Story Here</b> </font> <br> <hr><hr> <p align="justify"><font size="3" face="ARIAL"><b> To help us to post your story faster -- please supply some basic <br> information about your story below. Please try to answer all <br> pertinent questions, then click the "submit" button and submit your <br> story to the archive. Thank you.</b> </font><br><br> </p><hr> <hr> <form action="http://acctcgi.xxxxx.org/formmail.cgi" method="post"><font size="3"> <input name="subject" value="New Story Submission" type="hidden"> <input name="successpage" value="thanks.htm" type="hidden"> </font><pre><font size="3"><font size="4" face="ARIAL">Story title:</font> <input name="TITLE" size="50" type="text"> <font size="4" face="ARIAL">Author name or nickname:</font> <input name="NAME" size="50" type="text"> <font size="2" face="ARIAL">If you wish to remain anonymous leave blank</font> <font size="4" face="ARIAL">A brief description of your story:</font> <textarea name="COMMENTS" rows="10" cols="60"></textarea> <font size="4" face="ARIAL">Appropriate story codes: GENDER (Pick one that best describes your story)</font><br> <input name="ITEM1" value="xxxxx" type="radio">(xxxxx) xxxxx <input name="ITEM1" value="xxxxx" type="radio">(xxxxx) xxxxx <input name="ITEM1" value="xxxxx" type="radio">(xxxxx) xxxxx <input name="ITEM1" value="xxxxx" type="radio">(xxxxx) xxxxx <input name="ITEM1" value="xxxxx" type="radio">(xxxxx) xxxxx <input name="ITEM1" value="xxxxx" type="radio">(xxxxx) xxxxx <input name="ITEM1" value="xxxxx" type="radio">(xxxxx) xxxxx <input name="ITEM1" value="xxxxx" type="radio">(xxxxx) xxxxx <input name="ITEM1" value="xxxxx" type="radio">(xxxxx) xxxxx <input name="ITEM1" value="xxxxx" type="radio">(xxxxx) xxxxx <input name="ITEM1" value="xxxxx" type="radio">(xxxxx) xxxxx <input name="ITEM1" value="xxxxx" type="radio">(xxxxx) xxxxx <input name="ITEM1" value="xxxxx" type="radio">(xxxxx) xxxxx <input name="ITEM1" value="xxxxx" type="radio">(xxxxx) xxxxx <input name="ITEM1" value="xxxxx" type="radio">(xxxxx) xxxxx <input name="ITEM1" value="xxxxx" type="radio">(xxxxx) xxxxx <input name="ITEM1" value="xxxxx" type="radio">(xxxxx) xxxxx <input name="ITEM1" value="xxxxx" type="radio">(xxxxx) xxxxx <input name="ITEM1" value="xxxxx" type="radio">(xxxxx) xxxxx <input name="ITEM1" value="xxxxx" type="radio">(xxxxx) xxxxx <input name="ITEM1" value="xxxxx" type="radio">(xxxxx) xxxxx <input name="ITEM1" value="xxxxx" type="radio">(xxxxx) xxxxx <input name="ITEM1" value="xxxxx" type="radio">(xxxxx) xxxxx <input name="ITEM1" value="xxxxx" type="radio">(xxxxx) xxxxx <input name="ITEM1" value="xxxxx" type="radio">(xxxxx) xxxxx <input name="ITEM1" value="xxxxx" type="radio">(xxxxx) xxxxx <input name="ITEM1" value="xxxxx" type="radio">(xxxxx) xxxxx <input name="ITEM1" value="xxxxx" type="radio">(xxxxx) xxxxx <br> Other: <input name="GENDER" size="50" type="text"> <font size="4" face="ARIAL">Appropriate story codes: TYPE (Pick as many as necessary)<br> </font> <input name="ITEM2" value="xxxxx" type="checkbox">(xxxxx) xxxxx <input name="ITEM3" value="xxxxx" type="checkbox">(xxxxx) xxxxx <input name="ITEM4" value="xxxxx" type="checkbox">(xxxxx) xxxxx <input name="ITEM5" value="xxxxx" type="checkbox">(xxxxx) xxxxx <input name="ITEM6" value="xxxxx" type="checkbox">(xxxxx) xxxxx <input name="ITEM6" value="xxxxx" type="checkbox">(xxxxx) xxxxx <input name="ITEM7" value="xxxxx" type="checkbox">(xxxxx) xxxxx <input name="ITEM8" value="xxxxx" type="checkbox">(xxxxx) xxxxx <input name="ITEM9" value="xxxxx" type="checkbox">(xxxxx) xxxxx <input name="ITEM10" value="xxxxx" type="checkbox">(xxxxx) xxxxx <input name="ITEM11" value="xxxxx" type="checkbox">(xxxxx) xxxxx <input name="ITEM12" value="xxxxx" type="checkbox">(xxxxx) xxxxx <input name="ITEM13" value="xxxxx" type="checkbox">(xxxxx) xxxxx <input name="ITEM14" value="xxxxx" type="checkbox">(xxxxx) xxxxx <input name="ITEM15" value="xxxxx" type="checkbox">(xxxxx) xxxxx <input name="ITEM16" value="xxxxx" type="checkbox">(xxxxx) xxxxx <input name="ITEM17" value="xxxxx" type="checkbox">(xxxxx) xxxxx <input name="ITEM18" value="xxxxx" type="checkbox">(xxxxx) xxxxx <input name="ITEM19" value="xxxxx" type="checkbox">(xxxxx) xxxxx <input name="ITEM20" value="xxxxx" type="checkbox">(xxxxx) xxxxx <input name="ITEM21" value="xxxxx" type="checkbox">(xxxxx) xxxxx <input name="ITEM22" value="xxxxx" type="checkbox">(xxxxx) xxxxx <input name="ITEM23" value="xxxxx" type="checkbox">(xxxxx) xxxxx <input name="ITEM24" value="xxxxx" type="checkbox">(xxxxx) xxxxx <input name="ITEM25" value="xxxxx" type="checkbox">(xxxxx) xxxxx <input name="ITEM26" value="xxxxx" type="checkbox">xxxxx <br> Other: <input name="TYPE" size="50" type="text"> <font size="4" face="ARIAL">Public Author Contact Address:</font> <input name="EMAIL" size="50" type="text"> <input name="Annon" value="Yes" type="checkbox">Please hide my address.<br><br> </font><hr size="6" noshade="noshade"><center><font size="3" face="ARIAL">Story submission guidelines</font></center> <hr size="6" noshade="noshade"> <font size="2" face="ARIAL"><br></font><p align="justify"> <font size="2" face="ARIAL">Please follow these steps when submitting a story: <br><br> We want to have the files available to everyone. ASCII PLAIN TEXT is the basic medium and there is no one with computer access that can't read a text file. <br> The best format to send your story in, is "plain text" with white space between paragraphs. Don't format line length and don't worry about story length since we can accept any length story. <br><font size="4" color="#ff0000"><b> We will accept only plain text files. You may copy and <br> paste to the window below.</b><br></font> We will not accept DOC, WPS, or any other word processor formats. The archive staff apologizes for any inconvenience that this may cause contributing authors, but there are a few "funny" people out there who continually try to "pass along" viruses to us and with the proliferation of these viruses we find it no longer feasible to accept the risk. <br>If you are unable to copy and past and transmit your story using the archive poster please contact us through the link shown at the bottom of the page and we will try to accommodate you via regular email. But even then we will only accept ASCII plain text formats. <br> We will format your story using the above guidelines if you submit it in any other form.</font></p> <font size="2" face="ARIAL"><br> </font><center><table width="515" bgcolor="#999999" border="0" cellpadding="0" cellspacing="0"> <tbody><tr> <td valign="CENTER" width="515" align="left"><blockquote> <br> <center><font size="4"><b>Story Submission box</b></font></center></blockquote> </td> </tr> </tbody></table> </center> <font size="2" face="ARIAL"><font size="4" color="#000000" face="ARIAL">Copy and past your story he </font> <label for="Story"> <textarea name="STORY" rows="50" cols="62"></textarea></label> <br></font><center> <font size="2" face="ARIAL"> <input name="subject" value="New Story Submission" type="hidden"> <input name="successpage" value="thanks.htm" type="hidden"> <input value="Submit Story" type="submit"></font></center> </tr> </tbody></table> </center> <br> <center><a href="index.htm">Return to the Main Page</a></center> </body></html> How do I prefill an input field in a form? I don't mean "value=hello" I mean have a light gray text inside that says "enter your first name" and then when the user starts typing that text disappears. I thought there was an html tag that did this (or a form tag like type=""). I hope it doesn't require CSS... thanks! Hi Guys I have a text input field in a form that has data in it from a previous entries. Is there something i can do that ensures the field is empty when the form is pulled up? Thanks everyone Hi, I need some help. I am using a script which breaks down the cookie information to retrieve a cookie ID. This ID is then displaying using the following function: Code: <script type="text/javascript">var gac = new gaCookies(); document.write(gac.getUniqueId());</script> I have a form which my site visitors can fill in. On the form there is a text field called CookieID. What i am after, is getting the output of the code above to become the 'value' of the field... I am using the following javascript to populate the filed when the page loads: Code: function initForm(){ document.getElementById("Field110").setAttribute("value", "text_to_display"); } However, this function can only be used to display 'text' not html or a script. Does anyone have any insight as to how this could be done? Any help appreciated! I have a form field that I want to remember the text that was put into it after the submit button is pressed......do i need to do that with cookie or is there a way to make a form field remmber the last inputed data?.....for clarity's sake i don't mean for it to remember the data when a user comes back to the page just while they are visiting it. Here is a link to what I am working on now... http://209.97.201.191/ If you notice the drop down menus they disappear, or only partially show when using Firefox. In IE they work perfect. I have never come across this problem before. Any ideas as to what is causing it? Hi, I am a complete HTML novice and as such may lack certain use of terminology that you might take for granted so please allow for that. I have been linking to certain .jsp web pages , and pre-entering the data into the page by putting a "?" after the .jsp part and following it with some code. For example: - Take the page http://logis.korail.go.kr/driveinfo/TrainLocSearchg.jsp. By using the URL http://logis.korail.go.kr/driveinfo/...jsp?carNo=7001 I don't need to type the number 7001 in the form and press the submit button. This works fine on this page, however, for the following page, http://logis.korail.go.kr/driveinfo/...riveGuideg.jsp, I can't seem to get this method to work. I think the names of the fields in the form are as follows: - stYukCd wbMd1 wbMd2 trnKind trnNo trnUpDn I can't however get any of these fields to auto-fill by using this method. Any ideas? Thanks Damian I have no idea whether this is a reasonable thing to seek to do. My site is: http://archemni.co.uk/products_adw.php Have a look at the first product (MLDC). I am getting a lot of hits on my pages but no one is contacting us. We are not going to be setting up shopping carts etc. as that is not how the business works. What I was thinking of was a button or a link which would either take me to a form or open an email. That much is trivial, even for me! The problem comes because there are upwards of 100 products on there which are actually coded onto the pages (don't try persuading me to sql yet, I am not ready for that and not confident that it will not make us hard for google to 'pick up'). So I have some code like: Code: <h3>MLDC</h3> <p>MLDC is a premium professional detergent for machine dishwashing. Highly concentrated. Removes fats, proteins and starch residues. Suitable for use with all commercial dishwashers within catering establishments and professional kitchens.</p> <table class="table_products" cellspacing="0" summary="product specs"> <tr> <td class="body_products_emp">Uses:</td> <td class="body_products"><ul><li>General Machine Dishwashing use in areas with hard water - up to 400 ppm.</li></ul></td> </tr> <tr> <td class="body_products_emp" width="100px">Application:</td> <td class="body_products">Automatic dosing</td> </tr> </table> So I want a common piece of code that will, into either a field on a form or into the subject/body of an email paste 'something' that allows me to identify which product I am being contacted about. The ideal solution would be that I can write a bit of code which searches up the document and returns me the last statement which is wrapped in <h3></h3> (in this case MLDC). This would mean that I can have one bit of code which is common for every product and then it will return me a different product depending on which one a person is viewing. I am certain that this can be done, but I am only learning programming so do not know how. Can it be done in html? Do I need to resort to php or even javascript? Any help is greatly appreciated Adam Hi all! I'm trying to pass an array as a hidden field from a form in the URL of the browser but it's not working. Can you tell me what is wrong with this...it's my first attempt so be gentle The form HTML is <form name="filter" action="http://www.myurl.com" method="get"> <input type="hidden" name="main_page" value="index" /> <input type="hidden" name="Flt_Grade[]" value="100" /> <select name="filter_id" onchange="this.form.submit()"> <option value="1">Most Popular</option> <option value="2" selected="selected">Price: Low to High</option> <option value="3">Price: High to Low</option> <option value="4">Title</option> <option value="6">Date Added: Newest</option> <option value="7">Date Added: Oldest</option> </select> </form> I would expect, when option 4 in the dropdown is selected the URL to be http://www.myurl.com&main_page=index...00&filter_id=4 Where %5B = [ and %5D = ] But what I actually get is http://www.myurl.com&main_page=index...e=&filter_id=4 The Flt_Grade array is not passed properly. Can this be done so the hidden field is passed in the URL as an array? Thank you! Hey everyone! So after ruling out more complex Java implementations of passing a string onto the end of a static link, I'm attempting to do the same using <form> and onclick but am having difficulties. What I am trying to do is simple. There will be a form box where the user enters their ZIP CODE and then clicks a button 'Go'. Once clicked, I'd like to open a separate window (or possibly leave everything in the same window-not important) where the 'zip code' string (ie: 12345) is attached to the end of a static link (ie www.website.com/zip= ) to direct the user to the link 'www.website.com/zip=12345' I realize this is a simple idea, but thus far tutorials have lost me. This is the code that I have, but I admit it is a mess and might just be a better idea to ignore it: Code: <form> <input type="text" maxlength="8" name="zip" style="color:#555555;" value="Your ZIP" class="cleardefault" onclick="http://www.t-mobile.com/coverage/pcc.aspx?zip="+zip"> <input type="button" value="Go!" onclick="http://www.t-mobile.com/coverage/pcc.aspx?zip="+zip" > </form> Again, I know this is very n00bish and annoying, but if you could help I'd greatly appreciate the time! How do I hide the field names in the output from a form in email ? ex. Name. I want just the persons name to appear, not proceeded by the word name. I have a form but a text field and a hidden field don't come in form elements.I am alerting all form elements in a javascript function which is invoked on press of a button and these two form elements don't come. Any idea why that will happen. JS function which alerts the form elements is as follows :- function populateSubmitProfile() { var i =0; alert("Number of forms "+document.forms.length) ; for( i = 0 ; i < document.forms[0].elements.length ; i++) { alert("Name of the elements :"+document.forms[0].elements[i].name) ; } } Is there a way to put a custom graphic for the browse button in the file upload field, similar to how you can use a custom graphic for the submit button? Hey everyone, I have a 900px wide container div, and inside is a horizontal nav bar consisting of five buttons and a spacer image at the end to fill out the remainder of the width (six total images in all). The buttons consist of an unordered list of background images, floated left, and the spacer is an image that I threw on at the end. In Safari and Firefox (Mac and Windows), the page displays perfectly. In Internet Explorer, however, the final spacer image gets bumped down underneath the rest of the nav bar buttons. Its like IE is counting some extra pixels somewhere and deciding that the spacer image doesn't have enough room to fit in the 900px div. I'm pretty new to this, just learning as I go along - is this a common problem with IE, and is there a fix for it? I've tried removing the border from the container, not sure what else to try. Thanks! I'm looking for information on how to split a web page background, this is kind of hard to explain so i'll provide an example, http://www.torrentspy.com Can this be done with html and css only? Know of any tutorials or links for what i'm looking for? I was wondering if there is a way to split the back ground color of a page so that one half is one color and the other half is another I have just uploaded a new page at http://www.uncooking101.com/index.shtml , and for some reason the text it split up on IE. It shows just the first line to the right of the image, then everything else ends up below it so there is a large and very awkward space. The code is validated, and there is no problem in Firefox. A very similar scenario works fine at http://www.uncooking101.com/index.html . Does anyone know what in the world I am doing wrong?? If you don't see what I'm seeing, I uploaded a screenshot he http://uncooking101.com/images/iescreenshot.png I thank you in advance if you are able to help me! I'm new to really discussing these things. Usually my friend Google answers my tough situations, but I don't even know what to search for and am now about to pull my hair out! Hello Everyone! About 4-5 days ago I made my attempt to build my first webpage, I am using Dreamweaver cs4 my goal right now is to split my index page in half so I can have two columns, one side for a current video and the other for upcoming news. my site is www.canapictures.com and I will include a picture of what I am trying to achieve, thank you. The gray line in the middle is where I want it to split, and the box is where text would go, I want to line to be invisible if possible. |