Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie
Hi there,
There is an issue with role permissions that is being worked on at the moment.
If you are having trouble with access or permissions on regional forums please post here to get access: https://www.boards.ie/discussion/2058365403/you-do-not-have-permission-for-that#latest

Quick HTML forms question

  • 20-11-2003 11:19pm
    #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,700 ✭✭✭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