#1
  1. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jun 2000
    Posts
    3
    Rep Power
    0
    Howdy all...

    I'm using a form on a site, and one of the submit buttons calls a javascript function such as:
    <input type=button name=submit_button onClick="function();">

    My question is, I would like to change the image of this button. I've tried:
    <input type=image src=images/picture name=submit_button onClick="function();">

    This however doesn't seem to do the trick, without the type=button. If anyone can steer me in the right direction, or give me any help, I would be forever greatful...

    Thanks
  2. #2
  3. Contributing User
    Devshed Novice (500 - 999 posts)

    Join Date
    Feb 2000
    Location
    Perth West Australia
    Posts
    757
    Rep Power
    15
    You can put an onSubmit capture in the form tag and place your code there.
    <form onsubmit="function()">

    ------------------
    Simon Wheeler
    FirePages -DHTML/PHP/MySQL
  4. #3
  5. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jun 2000
    Posts
    114
    Rep Power
    15
    Internet Explorer recognizes a button tag. Just use it like this: <button>Button</button> The button tag supports most of the same attributes as other block elements, such as background images, size, visibility, etc... There's a really good tutorial about it at http://wsabstract.com/howto/button.shtml
    (part 1 of 2). Sadly, netscape just ingnores the tag, so you have to embed hyperlinks in it to make it functional in that browser.
  6. #4
  7. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jul 2000
    Posts
    4
    Rep Power
    0
    Hi! You can simply place image as submit button before the end of form end tag.
    <input type="image" src="filename.gif">
    This will act as submit button and take you to the header action in the form. you can modify you header if you need by placing another function call in onSubmit.
    Try this first.

    <BLOCKQUOTE><font size="1" face="Verdana,Arial,Helvetica">quote:</font><HR>Originally posted by puq:
    Howdy all...

    I'm using a form on a site, and one of the submit buttons calls a javascript function such as:
    <input type=button name=submit_button onClick="function();">

    My question is, I would like to change the image of this button. I've tried:
    <input type=image src=images/picture name=submit_button onClick="function();">

    This however doesn't seem to do the trick, without the type=button. If anyone can steer me in the right direction, or give me any help, I would be forever greatful...

    Thanks
    [/quote]



    [This message has been edited by marina (edited July 04, 2000).]

Similar Threads

  1. Enable form on radio button select
    By (sic)master in forum HTML Programming
    Replies: 2
    Last Post: February 8th, 2004, 04:19 PM
  2. Can I disable form elements using JavaScript
    By adamdan in forum JavaScript Development
    Replies: 1
    Last Post: September 4th, 2003, 10:37 AM
  3. php form variable like in JavaScript
    By genedavinci in forum JavaScript Development
    Replies: 1
    Last Post: January 27th, 2003, 06:01 AM
  4. Need help with a javascript in a form
    By newangler in forum JavaScript Development
    Replies: 3
    Last Post: September 16th, 2002, 06:36 AM
  5. Submiting form with javascript function....
    By hccfilms in forum JavaScript Development
    Replies: 1
    Last Post: March 16th, 2002, 10:33 AM

IMN logo majestic logo threadwatch logo seochat tools logo