HTML - Image Submit Button: Change Mouseover Button Color
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 Similar TutorialsHello Im creating a IE Mobile website, which has limited CSS capabilities ( see http://blogs.msdn.com/windowsmobile/...es/213771.aspx ) and jscript capabilities( http://msdn.microsoft.com/library/de...ects2_jrzu.asp ) I have been able to change the buttons color and my current version I have the following code that changes the page background color when a button is focused. I just want the buttons to change color when the focus is on it and when no longer focused goes back to normal, so the user knows they have moved to another button. <HEAD><title>MySite</title> <SCRIPT TYPE="text/javascript"> <!-- function setbg(color) { document.bgColor=color; document.body.style.backgroundColor=color; } //--> </SCRIPT> </HEAD> <BODY> <INPUT TYPE="BUTTON" NAME="Btn1" VALUE="1" onFocus="setbg('red')" > <INPUT TYPE="BUTTON" NAME="Btn1" VALUE="1" onFocus="setbg('black')" > </BODY> </HTML> Any suggestion on how to change just button color upon mouseover and mouseout? Well thanks for any help 1 can extend! I have this html code to make a button. This works OK. However I want to have a mouse over effect (text color change or back ground color change or ??) can someone add the correct code for that if it is possible to do. here is the code: ------ <p> <button style="height: 25px; width: 199px;color:black; background: lightblue; border="10"" onclick="window.location='http://www.cityofcarlton.com'"> <b>City of Carlton</b> </button> </p> ----------- I know of a way to do it with an embedded style tag in the <HEAD> section of your HTML page. <style type="text/css"> a:link {color:#000080; text-decoration: none;} a:visited {color:#946C6B; text-decoration: none;} a:hover {color:#FF0000; text-decoration: none;} a:active {color: #B70004; text-decoration: none;} </style> However I want it done within the button code itself. And I do not want to use css Thanks Okay. I'm trying to make it so when you mouseover a players "avatar" the border color changes from grey to red. The following code works PERFECT in IE, but FF, the border doesn't show up at all. CSS Coding: Code: img.avatar { border-color : #CCCCCC; border : 1px } img.avatar:hover { border-color : #ff0000; border : 1px } img.avatar:visited { border-color : #CCCCCC; border : 1px } img.avatar:hover { border-color : #ff0000; border : 1px } HTML Coding: Code: <TD align=middle width=104> <DIV align=center><A href="Link"><IMG class=avatar height=75 alt="" src="Image URL" width=75></A></DIV></TD> Hey, I need help making the bg color of an autoshape change its color by pressing a button. I'm using Microsoft FrontPage and am quite new to html. I know how to press a button and change the document background color but can not figure out how to do this but with an autoshape. Here is the code I have used to change the document background color: HTML Code: <div style="width: 110; height: 19; position: absolute; left: 903; top: 6"> <font size="2" face="Verdana,Arial,Helvetica,Sans Serif"> <input type="button" name="colr" onclick="document.bgColor='#0000FF'" style="color: #0000FF; width: 18; height: 18; border: 3px outset #0000FF; background-color: #0000FF"> <input type="button" name="colr" onclick="document.bgColor='#00FF00'" style="width: 18; height: 18; color: #00FF00; border: 3px outset #00FF00; background-color: #00FF00"> <input type="button" name="colr" onclick="document.bgColor='#FFFFFF'" style="width: 18; height: 18; color: #FFFFFF; border: 3px outset #FFFFFF; background-color: #FFFFFF"> <input type="button" name="colr" onclick="document.bgColor='#FFFFFF'" style="width: 18; height: 18; color: #FFFFFF; border: 3px outset #FFFFFF; background-color: #FFFFFF"> </div> It says document.bgcolor= ect but I cannot figure out the name of the autoshape so am not sure, in the html I think it only says the ID of the autoshape but do not know where to go from there. Please try and help and thanks in advance. 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? Hello, Is there a way to use a submit style button (so HTML automatically generates the button image) instead of having to have a image file? For example: <a href="../invoices.htm"> <img border="0" src="../btn_invoices.jpg" width="73" height="25"></a> where the src is can this be repalced with a button command? without using a FORM or POST option? Something similiar to: <button> <a href="http://www.microsoft.com/">Microsoft</a> </button> Thanks for your help, Doug I've followed this walkthrough on how to make a submit button with an image on it. The image part is working fine (along with the mouse up and over images) but the actulle submit function of the button is NOT working. Here is a link to the lession I have been following: http://www.codetoad.com/html/buttons...mit_button.asp And here is a link to the page with the non-working submit button: http://www.acreativeapproach.com/contact.html This is a pretty simple form That was made in DW. Do I need PHP to get a contact form like this to work? Thank you for your help JT 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 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"> 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> I'd like to improve the appearance of three buttons on an html page. i believe this is the code: Code: <input type="submit" name="purchase" value="Use Remaining Credits" style="margin:7px 0" style="padding:1px 2px 1px 2px" rel="gb_page_center[600, 635] "> <input type="button" name="search" value="Get New Credits" onclick="window.location.href='newcredits.php';" style="margin:7px 0" style="padding:1px 2px 1px 2px"> <input type="button" name="search" value="Search Again Now" onclick="window.location.href='page.php??page=12';" style="margin:7px 0" style="padding:1px 2px 1px 2px"> How can I add more attractive buttons, which would include the text "Use Remaining Credits", etc.? can you please provide a code example, with image code? Thanks hi there. i made a website for somebody years ago when i knew nothing about html. the code is absolutely crazily bad and i am looking to revamp it. the site is www.englishandproudofit.co.uk i know how to do the layout but its the buttons i am struggling with. what is the best way to make the buttons around the outside? i only want to use one image for all of the buttons and then have text on each button that also chnages colour on hover, pretty much how it is now but what would be the correct way to do it? all help greatly appreciated. thank you, sam I am having an impossible time finding the correct way to code this in Expression Web 4. I want to have an image that when it's moused over will change to another image, and back again to the original image when you move the mouse off. Nothing I can find online seems to do the trick, though. Any suggestions? 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 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> 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 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 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? 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 |