Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

HTML Forum


You are currently viewing our HTML Forum as a guest. Please register to participate.
Login



Post a Project »

Find a Professional HTML Freelancer!

Find a Freelancer to help you with your HTML projects

FREE Outsourcing eBook!

Reply
Forms - Reset graphic button
Old 10-13-2005, 11:57 AM Forms - Reset graphic button
weirdgear's Avatar
Novice Talker

Posts: 10
Location: Essex, England (UK)
Trades: 0
Is it possible to use a graphic in place of the default grey Reset button to clear the contents of the form?

This is the code I am using below;

<input type="image" src="images/submit_blk.gif" name="Submit" value="Submit">
<input type="image" src="images/clear_blk.gif" name="Reset" value="Reset">


After I click the clear button, the form submits instead of reseting!

Does anyone know what I am doing wrong?
weirdgear is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 10-13-2005, 12:14 PM
King Spam Talker

Posts: 1,186
Location: Manchester, UK
Trades: 0
If you use type="image", the browser renders a submit button. You need type="reset" for your reset button. You can use css to give the reset a background button:

HTML Code:
<html>
  <head>
    <style type="text/css">
      input.img {
      	background-image:  url(bg.gif);
      }
    </style>
  </head>
  <body>
    <form>
      <input class="img" type="reset" />
    </form>
  </body>
</html>
gringo is offline
Reply With Quote
View Public Profile Visit gringo's homepage!
 
Old 10-13-2005, 12:40 PM
weirdgear's Avatar
Novice Talker

Posts: 10
Location: Essex, England (UK)
Trades: 0
Thanks for your help gringo, I will try that out.
weirdgear is offline
Reply With Quote
View Public Profile
 
Old 10-13-2005, 03:37 PM
funkdaddu's Avatar
Web Design Snob

Posts: 635
Trades: 0
Another way is to just use a regular image and use JavaScript by putting

Code:
onclick="YourFormName.reset();"
in the IMG tag.
funkdaddu is offline
Reply With Quote
View Public Profile Visit funkdaddu's homepage!
 
Old 10-13-2005, 09:49 PM
Juanma's Avatar
Novice Talker

Posts: 9
Trades: 0
this is a example with js for give a Rollover image style for reset and submit form button:


In the html Head:

PHP Code:
<SCRIPT language="Javascript">
function 
send() {
document.form.submit();
}
</SCRIPT> 
and then intro the form tags:

HTML Code:
<form name="form" method="get">
   <a href= "javascript:send()" 
         onmouseOver="document.send.src='sending1.gif';"    
         onmouseOut="document.send.src='sending2.gif';">
   <img name="send" src="sending2.gif" border="0">
</a>
</form>

this example is simillary for reset buttom.

bye!
__________________
WebMaster -
Please login or register to view this content. Registration is FREE
, reseller Hosting and Dedicated Servers - We are the quality !!
Juanma is offline
Reply With Quote
View Public Profile Visit Juanma's homepage!
 
Old 10-18-2005, 06:06 AM
weirdgear's Avatar
Novice Talker

Posts: 10
Location: Essex, England (UK)
Trades: 0
Quote:
Originally Posted by funkdaddu
Another way is to just use a regular image and use JavaScript by putting

Code:
onclick="YourFormName.reset();"
in the IMG tag.
Thanks funkdaddu, that has done the trick.

Dave
weirdgear is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to Forms - Reset graphic button
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.54168 seconds with 12 queries