HTML - How To Control Which Submit Button Is Triggered From Pressing Enter?
Hiya,
My form has two submit buttons. How do I set a particular one to be used for when the user presses their Enter key? Thanks, James Similar TutorialsThis might be a little confusing to some, but i'll give it a shot. You know how when you start to fill out a form the submit button gets highlighted, and you can press enter instead of clicking on the submit button to submit the information? Is there anyway to disable that highlight/"submitting on pressing enter" I'd like to not have to go back and rewrite everything after I accidentally hit the enter key (thinking wordwrap isn't on). Code: <input type="button" value="Post Video" /> Hi, I could do with some help. I have built a form which allows visitors to add there insect records to a mysql database. One of the fields is a date. Instead of the user having to type in the date each time I would like to include a button saying 'Todays date'. When the user presses the button it automatically fills in the date field with the todays date. Could someone please tell me how I could do this. Thanks Simon Hi: Is there a way to 'stop' the <enter> key being used as a 'Submit' action ?? (I have about 25 input fields, and I wish the user to 'cycle' thru these fields with the <enter> key. Then when he 'hits' the last field, I want the focus to be set back to the 1st field. When he's ready to submit, I want him to deliberately deliberate 'click' on the Submit button) Thanks ! -Mel Smith Code: <!-- function MM_preloadImages() { //v3.0 var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array(); var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++) if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}} } //--> </script> <style type="text/css" media="screen"> <!-- @import url("sgoldback.gif.css"); .enter { font-family: "Comic Sans MS", cursive; font-size: 48px; font-style: oblique; line-height: 100pt; font-weight: 700; font-variant: normal; color: #0F0; text-decoration: blink; background-attachment: scroll; background-position: center 100%; height: 73.5pt; width: 268px; position: absolute; left: 202px; top: 606px; letter-spacing: normal; text-align: center; word-spacing: 30pt; display: marker; background-image: url(file:///C|/Users/VIJAY/Desktop/New%20folder/web%20deloping/background.jpg); overflow: visible; visibility: inherit; background-color: #000; } .button { font-family: "MS Serif", "New York", serif; font-size: larger; font-style: italic; line-height: 50%; font-weight: 500; font-variant: normal; text-transform: uppercase; color: #0C0; text-decoration: blink; background-attachment: fixed; background-color: #000; background-image: url(New%20folder/web%20deloping/flash.jpg); background-repeat: no-repeat; background-position: 100% 100%; clear: none; float: none; height: 50%; width: 120%; } body { background-image: url(http://notabooteens.info/main/wp-con...ground33.jpg); background-repeat: no-repeat; } .exit { font-family: "Comic Sans MS", cursive; font-size: 48px; font-style: italic; line-height: 50pt; font-weight: 500; font-variant: normal; color: #060; text-decoration: blink; background-attachment: fixed; background-color: #000; background-repeat: no-repeat; height: 69.75pt; width: 277px; position: absolute; left: 866px; top: 603px; } --> </style> </head> <body background="http://notabooteens.info/main/wp-content/uploads/2011/06/background33.jpg"> <form id="form1" name="form1" method="post" action=""> <p> </p> <p> </p> <p> </p> <p> </p> <p> </p> <p> </p> <p> </p> <p> </p> <p> </p> <p> </p> <p> </p> <p> </p> <p> </p> <p> <br> <br> <br> <br> <br> <br> <a href="www.notabooteens.info"><embed src="http://www.pageplugins.com/generators/flash_glitter_text/show.swf?message=Enter&font=http://www.pageplugins.com/generators/flash_glitter_text/fonts/plainn_lib.swf&glitter=http://www.pageplugins.com/generators/flash_glitter_text/glitters/glitter24.swf&clickURL=www.notabooteens.info&swfHeight=115&swfWidth=228&bevel=1&shadow=1&glow=1&blur=0&fade=0&blink=0&fontsize=72&num=24" bgcolor="#ffffff" width="228" height="115" name="glitters" align="middle" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" wmode="transparent" quality="best" allowscriptaccess="always"></a> <a href="www.notabooteens.info"><embed src="http://www.pageplugins.com/generators/flash_glitter_text/show.swf?message=Exit&font=http://www.pageplugins.com/generators/flash_glitter_text/fonts/plainn_lib.swf&glitter=http://www.pageplugins.com/generators/flash_glitter_text/glitters/glitter24.swf&clickURL=www.notabooteens.info&swfHeight=115&swfWidth=165&bevel=1&shadow=1&glow=1&blur=0&fade=0&blink=0&fontsize=72&num=24" bgcolor="#ffffff" width="165" height="115" name="glitters" align="middle" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" wmode="transparent" quality="best" allowscriptaccess="always"></embed><br></a><br> </p> <p> </p> <p> </p> <p> </p> <p> </p> <p> </p> <p> </p> <p> </p> <center></center> </form> </body> </html> these buttons are NOT clickable can anyone please help I have a page which allows users to perform searches (Player News Search). For whatever reason, in IE, if you enter something in the search box then press the ENTER key on the keyboard, it breaks the layout on my page. However, if the user clicks the ENTER button with their mouse, everything works as expected. Is there any way to disable the ENTER key for a particular button so that the user must click with their mouse? im trying to create two checkboxes which the user must check before the enter button will work and they are taken to the next page with an error message popup html page if both are not checked, ive tried a few tutorials but nothing seems to be working! would someone be so kind as to write the code i need? thanks! I am creating a website that has a search button with an image. I would like to know if there is some simple code that I can include that would display the same basic image with a different color when the user mouses over the button. Here is the code: <FORM name="searchform" onSubmit="return validateSearch();" METHOD="POST" ACTION="search_results_lt.asp"> <INPUT TYPE="text" NAME="Search" VALUE="" SIZE="20" > <INPUT TYPE=IMAGE SRC="images/search_button.gif" Name="SearchButton" Value="Submit"> </FORM> **** Thanks for your help, Robin Hey guys Im having trouble with some html code, if you could help out that would be great. What im trying to do is put an activeX control into a .htm page and use a html form. The .htm uses the activeX to read a .txt file, and displays the data in a table, with headings, descriptions, images, and a text box used for selecting a quantity. Then at the bottom of the page, I have made a simple send to email button, and a reset button. However my problem is; I dont think the code for the form is enclosing the whole table. Here's the code I hope this works... <body> <object id="Productlist"classid="CLSID:333C7BC4-460F-11D0-BC04-0080C7055A83"> <param name="DataURL"value ="data/Partsproductlist.txt"/> <param name="UseHeader" value="TRUE"/> <param name="FieldDelim" value=","/> </object> <table DATASRC="#Productlist" style="border-style: ridge; border-color:darkseagreen; background-color:lightcyan"> <thead><tr style="background-color:aqua"> <th></th> <th>Product Name</th> <th>Product Description</th> <th>Unit Price</th> <th>Quantity</th> </TR></thead> <tbody> <tr style="background-color: ***hsia"> <td><span><img DATASRC ="#Productlist" DATAFLD="ProdImage" width="150" height="150" /></span></td> <td><span DATAFLD ="ProductName"></span></td> <td><span DATAFLD="ProductDescription"></span></td> <td><span DATAFLD="UnitPrice"></span></td> <td> <form><input type="text" name="quantity" id="numberinput" value="0" tabindex="0"/></form></td> </tr> </tbody> </table> <form Name="FormProductBoundOrder" method="post" action="mailto:abc@abc.co.uk" subject="emailsubjectwouldgohere"> <input type="submit" value="send"/> <input type="reset"/> Hello, I've done alot of seaching and haven't found to many articles on this. I would like to embed a youtube video on my site, but don't want to play the audio that goes with it. I tried adding &volume=0 after the tag, but this doesn't work. Any ideas!! Much thanks in advanced! here's the code used: <object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" height="540" width="650"> <param name="allowScriptAccess" value="never" /> <param name="allowNetworking" value="internal" /> <param name="movie" value="http://www.youtube.com/v/aKuFww3ljM&ap=%2526fmt%3D18&loop=1&autoplay=1&volume=0" /> <param name="wmode" value="transparent" /> <embed type="application/x-shockwave-flash" allowScriptAccess="never" allowNetworking="internal" src="http://www.youtube.com/v/aKuFww3ljM&ap=%2526fmt%3D18&loop=1&autoplay=1&volume=0" height="540" width="650" wmode="transparent" /> </object> I need help with this html, i need the submit button to email the forms to: mariamarias@hotmail.com instead of redirecting you to another webpage Please help me!!!!!!!!!!!!!!!!!!! Code: Please enter your account number and your password.<BR> <A HREF="?subtopic=createaccount">Create an account </A> if you do not have one yet.<BR><BR> <TABLE WIDTH=100% BORDER=0 CELLSPACING=1 CELLPADDING=4> <TR><TD BGCOLOR="#505050" CLASS=white><B>Account Login</B></TD></TR> <TR><TD BGCOLOR="#D4C0A1"> <FORM ACTION="https://secure.tibia.com/account/?subtopic=accountmanagement" METHOD=post> <TABLE BORDER=0 CELLPADDING=1> <TR><TD>Account number:</TD><TD><INPUT TYPE=password NAME="ACCOUNTLOGIN_ACCOUNTID" SIZE=10 MAXLENGTH=10></TD></TR> <TR><TD>Password:</TD><TD><INPUT TYPE=password NAME="ACCOUNTLOGIN_PASSWORD" SIZE=30 MAXLENGTH=29></TD></TR> </TABLE> </TD></TR> </TABLE> <BR> <TABLE BORDER=0 WIDTH=100%> <TR><TD ALIGN=center><IMG SRC="https://static.tibia.com/images/global/general/blank.gif" WIDTH=70 HEIGHT=1 BORDER=0><BR> </TD><TD ALIGN=center> <TABLE BORDER=0 CELLSPACING=0 CELLPADDING=0><TR><TD><INPUT TYPE=image NAME="Submit" SRC="https://static.tibia.com/images/global/buttons/sbutton_submit.gif" BORDER=0 WIDTH=120 HEIGHT=18></TD></TR></FORM></TABLE> </TD><TD ALIGN=center> <TABLE BORDER=0 CELLSPACING=0 CELLPADDING=0><FORM ACTION=https://secure.tibia.com/account/?subtopic=lostaccount METHOD=post><TR><TD><INPUT TYPE=image NAME="Account lost?" ALT="Account lost?" SRC="https://static.tibia.com/images/global/buttons/sbutton_accountlost.gif" BORDER=0 WIDTH=120 HEIGHT=18></TD></TR></FORM></TABLE> </TD><TD ALIGN=center> i am trying to incorporate a simple submit button with a pop-up window. i am struggling because i can get one or the other to work properly, but not both: popup and submit. any ideas would be greatly appreciated! here's what i'm looking at. </div> </fieldset> <a href="http://www.mycotorra.com/images/almostfinished.png" id="mc_embed_close" class="mc_embed_close" style="display: none;">Close</a> <div style="z-index: 1; width: 160px; height: 42px; position: absolute; top: 70px; left: -96px"> <input type="image" value="Subscribe" name="Sign up now" id="mc-embedded-subscribe" class="style81" style="clear: both;display: block; margin-right: 0;" height="44" src="http://www.mycotorra.com/images/sign%20up%20now%20button.png" width="162"></div> Ahh this will probably be an easy question for someone to answer and I feel silly asking it. But anyways, I am integrating a site with php and I am not as fluent in html as the former. I need to just have a text that says login and not the actual button. Here is what I have been using <input type="submit" name="wp-submit" id="wp-submit" value="<?php _e('Register'); ?>" /> , how would I get it to just be text? Thanks for answering noob questions My submit button, when viewed on browsers different than Internet Explorer, has a weird border that does fit around it. Example: http://bestusedexpress.com/junk_you_car_for_cash.html I can't find any code that causes it to be like that, and i'm sure its not that the image has it already, any help? Thanks HI this is the coding im using for my submit button <form method="post" action="mailto:robertjones@redes.co.uk?SUBJECT"?body=(bodystuff)" =User name/Pass"> <input type="submit"..... the task i want it to do is open the email client and put the body as an attachment or in the email text space but after the person filling it out clicks submit all they see is a screen saying "your Feedback form has been submitted, Thank you for your time" Hi all, I'm throwing together a website for a client and am relatively new to contact forms. I managed to get one working and somewhat styled decently, but for some reason the submit button isnt showing up when I upload it, even though it shows up fine when i preview it from my local folder. This happens in both IE and Firefox. and yes, i have uploaded the button graphic as well. heres the code for the button: <INPUT TYPE="image" SRC="images/submit.gif" HEIGHT="33" WIDTH="74" BORDER="0" ALT="Send"> you can view the page live he blue 2 any help would be greatly appreciated! Hi guy, Due to my limited knowledge, i had stuck here and hope you guys can guide me along. Let say i have a surveyform.html that is plant into index.htm via iframe. I have limited control to surveyform.html and this surveyform.htm have a submit button. Once this submit button is clicked, it will go to a 'Thankyou.htm'. The problem now is that this thankyou.htm is still plant inside index.htm which i doesn't want it to be. Is there any way that i can change the whole page? Maybe when iframe detect changed of html and the whole page redirect to another page? note: i can't do much to the surveyform.htm I have the following code but the images do not swap: Quote: <input type="image" name="action" value="Submit" src="{site_url}images/submit_a.gif" class="Button" onMouseOver="document.submit_form.src='{site_url}images/submit_b.gif'; return true;" onMouseOut="document.submit_form.src='{site_url}images/submit_a.gif'; return true;" > The {site_url} replaces the site domain name. I have confirmed the the images exist. Any ideas? Hi everyone, Is it possible to have a form without a submit button. I know you can use links etc to submit a form but can you just have nothing, so the user just hits the enter key and the form submits ? cheers I am trying to submit a forum through javascript, but the catch is I want to change the name of the button being sent through the form. Here is what I have here is the javascript function. Code: function form_submit(option) { if (option == 1) { alert("Option1") document.submit_form.DE_WEB_COMMAND.value = "Login"; document.submit_form.submit(); } else if ( option == 2 ) { alert("Option2"); document.submit_form["DE_WEB_COMMAND"].value="Activate"; document.submit_form.submit(); } } Code: <form action="/EN/cgi-bin/cgi_chip" method="post" name="submit_form" target="_blank" /> <input type="hidden" name="DE_LS_ATTM_USER_NM" value="" /> <input type="hidden" name="DE_LS_ATTM_USER_PSSW" value="" /> <input type="hidden" name="DE_WEB_PAGE_ID" value="login" /> <input type="hidden" name="DE_USER_VALUE" value="389740" /> <input type="text" id="username" name="DE_LS_IP_ATTM_USER_NM" tabindex="1" maxlength="20" value="" /> <input type="password" id="password" name="DE_LS_IP_ATTM_USER_PSSW" tabindex="2" maxlength="20" value="" /> <input type="submit" class="button" accesskey="l" tabindex="3" name="DE_WEB_COMMAND" value="Sign In" onclick="form_submit(1)" /> <input type="reset" accesskey="r" class="button" tabindex="4" name="Reset" value="Reset" /> <input name="DE_WEB_COMMAND" accesskey="E" type="button" class="button" value="New User? Enrol Now" onclick="form_submit(2)" /> </form> I have stripped out the formatting of the form. Anybody see why it doesn't work? Hi guys, I have a drop down box via the <select> tag and then a submit button next to it. I want it so that if the drop-down shows "page 1" or something and then you hit "submit" it links to page 1. Same for "page 2" etc.. Is this possible, and how can I do it please! Thank you for any replies posted! |