button images

  • tommya
  • Graduate
  • Graduate
  • tommya
  • Posts: 221
  • Loc: United Kingdom

Post 3+ Months Ago

Can an image be used to display a form button? instead of the drab grey boxes?

If so, how?
  • Anonymous
  • Bot
  • No Avatar
  • Posts: ?
  • Loc: Ozzuland
  • Status: Online

Post 3+ Months Ago

  • joebert
  • Fart Bubbles
  • Genius
  • User avatar
  • Posts: 13502
  • Loc: Florida

Post 3+ Months Ago

Code: [ Select ]
<form action="submitTo.asp" method="post">
<img src="buttonImage.jpg" onclick="submit();">
</form>
  1. <form action="submitTo.asp" method="post">
  2. <img src="buttonImage.jpg" onclick="submit();">
  3. </form>


You can change onclick="submit();" to any function you want :wink: for example, onclick="validate();"
  • frans26
  • Novice
  • Novice
  • User avatar
  • Posts: 34
  • Loc: Close to Lao

Post 3+ Months Ago

you can also use css to make it look a little better.
  • tommya
  • Graduate
  • Graduate
  • tommya
  • Posts: 221
  • Loc: United Kingdom

Post 3+ Months Ago

what does the validate function do?
  • fional24
  • Graduate
  • Graduate
  • fional24
  • Posts: 125
  • Loc: Scotland

Post 3+ Months Ago

that will check the information entered by the user of the form against rules you have defined in your code. A common example is to check a valid email address has been entered.

You will need to define the function code yourself.
  • rtm223
  • Mastermind
  • Mastermind
  • User avatar
  • Posts: 1855
  • Loc: Uk

Post 3+ Months Ago

ummmmm, I seem to remember seeing:
Code: [ Select ]
<input type="image" src="myimage.gif" alt="my USEFUL alt text" />

around somewhere, maybe at webmonkey, don't know. Quick google found this:
http://www.hardcoder.com/html/frm3_butt ... hicButtons

Don't ask me if it is any good for browser compatibility or standards compliance because I haven't checked. but if it does work then it seems a bit more elegant than fiddling with Javascript to me.
  • darkthroniar
  • Beginner
  • Beginner
  • User avatar
  • Posts: 42
  • Loc: Los Angeles, CA

Post 3+ Months Ago

hi tommya

you should try styles, is pretty easy :)

<input name="submit" type="submit" style="background-image: url(images/imag.gif)">

and that's it

Post Information

  • Total Posts in this topic: 7 posts
  • Users browsing this forum: prathyusha and 84 guests
  • You cannot post new topics in this forum
  • You cannot reply to topics in this forum
  • You cannot edit your posts in this forum
  • You cannot delete your posts in this forum
  • You cannot post attachments in this forum
 
cron
 

© 1998-2014. Ozzu® is a registered trademark of Unmelted, LLC.