HTML - Disabling Enter Key Submission For Button
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? Similar TutorialsCode: <!-- 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 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! 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 How can I restrict form submission to only the Submit button? I find the forms can be submitted also by the user pressing the "enter" or the "return" key (Users typically use IE or Firefox) By a mouseover the "Submit" button, a final check of data integrity is done as follows.... <INPUT type="submit" value="Submit Form" onmouseover="validate(personal_SS.value,personal_SS.id,personal_lastname.value,personal_lastname.id, personal_firstname.value,personal_firstname.id,personal_Birthdate.value,personal_Birthdate.id)"> <INPUT type="reset" value="Clear form"> Data is 128 bit SSL encrypted function validate(strngSS,x,strngLN,y,strngFN,z,strngBD,w) { if (strngSS== "") {alert("You didn't enter a Social Security Number."); document.ReturnPatientEntry.x.focus(); return; } else { if ((strngSS.length < 9) || (strngSS.length > 9)) {alert("The Social Security Number is the wrong length. Just use numbers, no dashes... like 123456789 not " + strngSS); document.ReturnPatientEntry.x.focus(); return; } else { var illegalChars = /\W\#/; if (illegalChars.test(strngSS)) {alert( "The Social Security Number contains illegal characters. Just use numbers, no dashes or # signs."); document.ReturnPatientEntry.x.focus(); return; } } } validateLN(strngLN,y) validateFN(strngFN,z) validateBD(strngBD,w) } function validateLN(strng,x) { if (strng== "") {alert("You didn't enter a Last Name."); document.ReturnPatientEntry.x.focus(); return; } else { if ((strng.length < 3) || (strng.length > 15)) {alert("The Last Name is the wrong length. Just use letters, no dashes... " + strng); document.ReturnPatientEntry.x.focus(); return; } else { var illegalChars = /\W\#/; if (illegalChars.test(strng)) {alert( "The Last Name contains illegal characters. Just use letters, no dashes or spaces."); document.ReturnPatientEntry.x.focus(); return; } } } } function validateFN(strng,x) { if (strng== "") {alert("You didn't enter a First Name."); document.ReturnPatientEntry.x.focus(); return; } else { if ((strng.length < 2) || (strng.length > 12)) {alert("The First Name is the wrong length. Just use letters, no dashes... " + strng); document.ReturnPatientEntry.x.focus(); return; } else { var illegalChars = /\W\#/; if (illegalChars.test(strng)) {alert( "The First Name contains illegal characters. Just use letters, no dashes or spaces."); document.ReturnPatientEntry.x.focus(); return; } } } } function validateBD(strng,x) { if (strng=="") {alert("Please enter a valid Birthdate"); document.ReturnPatientEntry.x.focus(); return; } else { if ((strng.length<8) || (strng.length>8)) {alert("Please enter your Birthdate in the form mm/dd/yy, not " + strng); document.ReturnPatientEntry.x.focus(); return; } else { var illegalChars=/[\-\.\m\,\ ]/; if (illegalChars.test(strng)) {alert("The Birtdate contains illegal characters, use the format mm/dd/yy, not " + strng); document.ReturnPatientEntry.x.focus(); return; } } } } I know the coding is primitive, but it works. If the "Clear form" button is pressed, multiple consecutive error messages are tripped as the form is cleared. Can I suppress this as well? Thanks, Douglas McKibbin augustasurgery.org I have a banner I've created. I know how to add the banner to pages and such so that it's displayed and you can click it to head to the webpage it's advertising. What I need to know is how to post the actual HTML coding so that other's can copy it and use it to advertise also. How do I disable the HTML so that the coding is displayed and not the image? Here's the image... <a href="http://www.myspace.com/headforthestorm" target="_blank"><img src="http://i190.photobucket.com/albums/z211/tokillthepurestdove/HeadforTheStormBanner.jpg" border="0" alt="Head For The Storm"></a> Hi, I was wondering is there a HTML script I can put on my website so visitors can't use there keyboard/pad. Instead just using there mouse. I have seen this done on numerous game sites and would like it for my website. Thank you Hi Everyone, I'm creating my first site for myself and need a little help. I have an image map that has a hotspot in it. When the user clicks the hotspot I have a javascript code that creates a random number and inserts it into a text box further down the page. I want tomake it so that users can only click on the image hotspot once and only generate one number. Is there a way to do this? and to ensure that if a user refreshes the page that they are still not able to click on the hotspot again. Thanks in advance Where I have a flash drop down nav bar on top of html it is disabling the links that are underneath the flash nav bar. In firefox even the links in the nav bar do not work where they overlap. HELP!!!! Much appreciative ...Cory Here is the link... http://209.40.102.3/cory/PSBrokerage.asp Hi: I wish my users to be able to press the <Enter> Key to move forward from one input field to the next (and yes, I know that the <Tab> key more properly does this also). However, my users are mostly old-school desktop app users, where the <Enter> key moves forward field-by-field, and the <tab> key was hardly ever used. In my Registration page, there are twelve textual input fields that I wish to have my users allowed to use the <Enter> key to move ahead field-by-field. How do I accomplish this please ?? Thanks for any assistance offered. -Mel Smith I have a log out button at the right side top of the page, and some text fields and then another button .When ever I enter something in textfield and hit enter I get logged out.How to stop this. Thanks in advance can someone do me a huge favor and build the simplest html page ever... well heres what it looks like right now http://jab-gaming.com/, i built it w/ my crappy skills (mostly copying from other pages), can someone build practically the same thing but make it look better? im aiming for something like this http://www.boss-gamers.com (w/o the re-directing) the links for the page w/ music is http://jab-gaming.com/page2.html and the link for the image is http://jab-gaming.com/page.html. thanks in advanced, the flash EDIT: the page i made only works in firefox for some reason, not in IE Im developing a site that needs a Voting Access Page, to get to the content. For example: http://www.clubkings.prv.pl, and go to the "Fresh Mp3" Link on the left hand side. I want visitors to do the same, where on each click, an advert is displayed in an external pop-up box or window, and then the next step highlighted until they get to access the page. I have to admit, i was considering php instead after using login pages in previous sites through this method, but is there or does anyone have a HTML script that i can modify to put into this site I am working on. I have attempted to view the source and adapt from various sites, but its not all there to see. Thanks if you can be of any assistance Jai I have a form that has 3 search fields. If the user types in a value in the 3rd field and hits the Enter key the first submit button is highlighted for the first search field. How do I disable the Enter key and force the user to press the Search button after typing a value in each filed. Also the user only has to pick one field to search by and can leave the other two blank. HTML Code: <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html> <head> <title>Untitled</title> </head> <body> <form name="search" action="Index.cfm" method="post"> <p>Enter Product Owner's CWS ID:</p> <input type="text" name="productOwner" value="productOwner" size=30> <input name="productOwnerSubmit" type="submit" value="Search"> <p>Enter GPO's CWS ID:</p> <input type="text" name="gpo" value="gpo" size=30> <input name="gpoSubmit" type="submit" value="Search"> <p>Enter Partial or Complete Application Name:</p> <input type="text" name="application" value="application" size=30> <input name="applicationSubmit" type="submit" value="Search"> </form> Angel </body> </html> Hi folks I need some pointers on how i can have the Enter and Exit links on my welcome page to be within the center of the page. Input on this would be much appreciated. Also what is the code for the yellow comment box when you have your mouse over a object? Th i av! Gaz. 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 I recently just created a site: http://celticsinsider.webs.com, and I was wondering how I could put an article submission button on one of my pages? I only know html, by the way. Currently i have this bit of code on this site(www.rrelive.com/again/index.html) <form name="myform" onSubmit="location.href=document.myform.mytext.value"> <input type="text" name="mytext" onChange="location.href=document.myform.mytext.value"> <input type="button" onClick="location.href=document.myform.mytext.value" value="Go"> </form> But everytime i press enter it doesnt excecute the buttons code, so then it says the wrong thing in the URL Right now i want it to say"www.rrelive.com/again/hello" if i write hello in the box and hit enter. This works if i CLICK the button(Go). But not when i hit enter. When i hit enter it writes "www.rrelive.com/again/index.html?mytext=hello". 1000 Thanks in advance! I am building a site with two simple forms in it - they are purely for sending through some info, name address etc to an email address. When I put a form in and test it, I click the submit button and it opens outlook and proceeds to send the data in a long line. Is this all possible in html? I want to do it in the simplest way possible. Many thanks for your help. ...................... Hi guys, i'm new to the job, and having a bit of bother with some code, ive written the stuff below to give me a submission form (which works great) but when the form is submitted, i need it to link to a page in the same window to thank the customer for submitting, and so i can place a some tracking code into the same page. can someone help me by telling me how to embedd this link? With thanks, AL <form action="mailto:allan.doyle@dalescycles.com?subject=cyclescheme" method=post encType=text/plain> Full name: <input type="text" name="fullname" value="" maxlength="100" /> <br /> E-mail: <input type="text" name="email" value="" maxlength="100" /> <br /> Telephone: <input type="text" name="phone" value="" maxlength="100" /> <br /> Bike: <input type="text" name="bike" value="" maxlength="100" /> <br /> Bike size: <input type="text" name="bikesize" value="" maxlength="100" /> <br /> <input type="submit" value="Submit" /> </form> |