HTML - Default Submit Button On Form
<html>
<form> <p><input type="text" name="T1" size="20" /></p> <p><input type="submit" value="B1" name="B1" /></p> <p><input type="submit" value="B2" name="B2" /></p> </form> </html> Say I have the above form in a web page. When the page loads, the browser will highlight the first submit button b1, such that if the user hits enter, the form is submitted with that button. I'd like the default button to be B2, which is displayed second on the form. I'd greatly appreciate any advice on how to accomplish this. Thanks, jsfgguy Similar TutorialsHi 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 Hi guys, I have made a website, and it has a text box that I want people to type their email address in, and I have a regular link next to it that says "submit" (not a button or anything). Basically I want the email address that they have entered to be emailed to me when they click the submit link. My hosting is currently just free-hosting at awardspace - is this possible to do there? If not - generally how can I make it work? Thank you for any replies posted :-) Ok, so I hope there is a simple answer to this. I just haven't been able to figure it out. I have a basic form that has a dropdown menu. I am using an image as the submit button. The problem I am having is that the image does not align vertically properly next to the dropdown menu. Below is what my form looks like in the browser. Any ideas how to get this aligned correctly? Thanks for all help! I am having a bit of a problem. I need to replace a submit button with an image (addtocart.gif). It sounds easy enough, but for some reason when I change the coding, my link does not pop-up in a new window, as it currently does. I need the image to open up my shopping cart preview page. Any help would be greatly appreciated. Code: <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> <html> <head> <title></title> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> <script type="text/javascript"> var mywindow; var features='width=530,height=500,left=200,top=200,scrollbars=yes'; window.onload=function() { document.forms[0].target='mypopup'; document.forms[0][3].onclick=function() { makePopup(); } } function makePopup() { if(mywindow) { mywindow.close(); } mywindow=window.open('','mypopup',features); mywindow.focus(); } </script> </head> <body> <form method="post" action="http://ww11.aitsafe.com/cf/add.cfm"> <div> <input type="hidden" name="userid" value="D745330"/> <input type="hidden" name="price" value="19.95"/> <select name="product"> <option value="Red shirt w/ logo (XS)">X-Small</option> <option value="Green shirt w/ logo (S)">Small</option> <option value="Blue shirt w/ logo (M)">Medium</option> <option value="Red shirt w/ logo (L)">Large</option> <option value="Green shirt w/ logo (XL)">X-Large</option> <option value="Blue shirt w/ logo (XXL)">XX-Large</option> </select> <p> <input type="submit" name="post" class="submit" value="submit"/> </div> </form> </body> </html> Hi, I got a HTML form whose submit button doesnt seem to be working, Any help would be appriciated. The link to the form is http://new.johnnyshotel.com/contact.html . I tried the same form in a different plain html file and it seems to work but when I insert it back into this webpage template the submit button doesnt seem to work. Thanks in advance. Hello All! I am a newbie to HTML and am having the most troubling time getting my submit button on my form to redirect to another webpage. I have been reading (searching) through previous posts on this issue but none solved my problem. I am really hoping someone can offer some help so let me explain my issue exacly. I have a simple form on my "Contact Us" page with a few fields and a [Submit]button. After the form is filled out and the [Submit] button is pressed, I would like it to re-direct to a "Thank-You" page I created. Below is my code: <form action="gdform.asp" method="post" name="contact_us" id="contact_us" target="cont"> <input name="submit" type="image" value="submit" src="images/Submit.gif"> If I take target="cont" out, it redirects to the home page. I have been trying to figure this out for so long now and searching online with no luck. Any help with this would be GREATLY appreciated!!!! Thanks! I have created a button which is linked to some JavaScript to dim the screen when it is pressed. using CSS I have changed the image of the button using a graphic. The graphic is a .PNG as it uses transparency but when set the image as the button it has lost all transparency is there anyway to enable the transparency of the .PNG this is the code I am using to do it. Code: <input type="button" onClick="d()" class="button"> On as in pre-selected when a page loads... 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 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 was just curious when I make a form element, if there is a default name that is set to that form if I do not use the "name=" attribute". Hi All its been quite some time since i have hand coded anything and i am having some probs with a form i am using.. i want to use my own image for the button instead of the default.. can someone let me know how this code should look to use my own image.. any help would be much appreciated Code: <table cellpadding="0" cellspacing="0" border="0"> <tr> <td><input type="text" name="loginusername" accesskey="u" tabindex="1"></td> <td style="padding-left: 5px;"><input type="password" name="loginpassword" value="" accesskey="p" tabindex="2"></td> <td style="padding-left: 5px;"><input type="submit" name="login" value="Login" accesskey="l" tabindex="3"></td> </tr> <tr> <td class="loginusername" style="padding-top: 3px;">Username</td> <td class="loginpassword" colspan="2" style="padding-left: 5px; padding-top: 3px;">Password</td> </tr> </table> This is a problem that i driving me crazy. I have this forms on my website that people can use to post comments. They have one textarea that they should write their name in and another that they should write their comment. I try to make the default text "Namn" and "Kommentar", but only "Namn" is showing in firefox. The weird thing is though, that if I change places between the two textareas, both are showing fine. I provide the site with the source code, and for a quicker check, the code for the two textareas. <textarea name="db_comment_namn" type="text" value="Namn" rows="1" cols="15" style="font-size: xx-small; font-family: Verdana; font-weight: Bold; font-style: Italic; border: 1px inset #CCCCCC; padding: 1px;">Namn</textarea> <textarea name="db_comment_kommentar" type="text" value="Kommentar" rows="1" cols="50" style="font-size: xx-small; font-family: Verdana; font-weight: Bold; font-style: Italic; border: 1px inset #CCCCCC; padding: 1px;">Kommentar</textarea> http://foto.jaxell.se Thanks in advance. 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> 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 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> 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! 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" When you type your email address into the text field and press submit, nothing happens. Here is my form code. I think everything is right on the database side... I didn't write it, or this, but I need to fix it xD I think the code was written in frontpage (I'm a notepad coder, myself), so there's some garbage in there. Any help would be appreciated. Thanks, Sondra Code: <form method="POST" name="e-newsletter" action="../librarynews-submit.asp"> <p>Email <input type="text" name="email" size="25"></p> <hr> <p> <input type="checkbox" name="teen" value="yes">Check this box if you would also like to subscribe to the QPL Teen Newsletter. </p> <!--<p><select size="1" name="Interest" multiple> <option selected>General</option> <option>Children's Activities</option> <option>Teen Events</option> <option>Adult Programs</option> <option>Book Sale Notification</option> <option>Friends of the Library</option> <option>New Arrivals</option> </select> <font face="Arial">Area of Interest</font></p>--> <p> <input type="submit" value="Submit" name="Submit"> </p> </div> </form> 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? |