Advertisement
Help Keep Boards Alive. Support us by going ad free today. See here: https://subscriptions.boards.ie/.
If we do not hit our goal we will be forced to close the site.

Current status: https://keepboardsalive.com/

Annual subs are best for most impact. If you are still undecided on going Ad Free - you can also donate using the Paypal Donate option. All contribution helps. Thank you.
https://www.boards.ie/group/1878-subscribers-forum

Private Group for paid up members of Boards.ie. Join the club.

Quick HTML forms question

  • 21-11-2003 12:19AM
    #1
    Banned (with Prison Access) Posts: 5,154 ✭✭✭


    Hi folks,
    I've made a form for a website, with the basic "Submit" and "Clear Form" buttons, the form works fine. I then changed the buttons to images to make it fit more with the look of the site. Thing is, now the clear button does the same as the submit button. Can anybody think of a reason for this to happen?

    Thanks,
    Sinecure.


Comments

  • Closed Accounts Posts: 304 ✭✭Zaltais


    As far as I know (and I could be wrong!) an <input type="image" src="blah.gif"> is by default a submit button. There is no option for an <input type="image"> to be a 'clear form' button or anything else - it's either a submit button or just a regular image (i.e. <img src="blah.gif">).

    However, that said - you can always make an image (either 'input image' or 'regular image') a 'clear form' button really easily using javascript.


  • Banned (with Prison Access) Posts: 5,154 ✭✭✭Oriel


    Yeah, I checked that out. So it looks like I have the option of either having one good Submit button or a crappy Submit and and crappy Reset button too.

    Don't think I'll bother with the Javascript - it's just an extra function for a site which is only for a college thing.
    Thanks for the help.

    Sinecure.


  • Closed Accounts Posts: 304 ✭✭Zaltais


    Well the javascript for the reset button could be as simple as
    <img src="blah.gif" onClick="document.theFormName.reset()">

    (replace "theFormName" with whatever you've put in the "name" field of the <form> tag.....)

    You could make it more difficult if you wanted... but it don't get much easier than that.....


  • Registered Users, Registered Users 2 Posts: 19,396 ✭✭✭✭Karoma


    alternatively, use normal buttons + CSS (?)


  • Closed Accounts Posts: 9,698 ✭✭✭tricky D


    try:

    .orangebutton { background-color: #ffffff; color: #ff9933; border: #ffccff 1px solid; font-size: 129%; }
    in a style sheet

    and sticking class="orangebutton" attribute in submit and reset buttons tags

    or more directly, just stick

    style="background-color: #ffffff; color: #ff9933; border: #ffffff 1px solid; font-size: 129%;" in the buttons' html

    doesn't work for file upload browse buttons tho


  • Advertisement
Advertisement