SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Enthusiast
    Join Date
    Jun 2000
    Location
    Peterborough, England
    Posts
    50
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Does anyone know how to make a picture into a button? I cannot believe that it cannot be done?! I have been trying and trying for the past 2 hours, but I cannot seem to do it. The reason I want to do it is so that I can write on the web site click the image to be taken to another window, rather than have a little button that looks boring. Please - can anyone help me?

    The JAVA-Script below is what I am using. It is used to open a smaller window where a password can be entered. The button that appears on the page is represented by the HTML:
    “<form>
    <input type="button" value="Enter Here" onClick="gateKeeper()"
    </form>”
    which can be seen below. I believe it is the ““button”” bit that I need to change to a picture.


    <SCRIPT LANGUAGE="javascript">
    <!--- Hide from tired old browsers
    var nifty_little_window = null;
    function gateKeeper() {
    nifty_little_window = window.open('woodstonclothingcompany.html', 'theKeeper',
    'width=350,height=200,resizable=1');
    }
    // End hiding --->
    </SCRIPT>
    <form>
    <input type="button" value="Enter Here" onClick="gateKeeper()"
    </form>


    I very much thank you for reading my query and i look for in anticipation to a reply... :-)

  2. #2
    Your Lord and Master, Foamy gold trophy Hierophant's Avatar
    Join Date
    Aug 1999
    Location
    Lancaster, Ca. USA
    Posts
    12,305
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    In your input tag put "type='image' src='pathtofile/filename.ext'"

    ------------------
    Wayne Luke - Sitepoint Forums Administrator
    Digital Magician Magazine - MetaQuark Creations (Coming Soon)
    sitepoint@digitalmagician.com

  3. #3
    Dumb PHP codin' cat
    Join Date
    Aug 2000
    Location
    San Diego, CA
    Posts
    5,460
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Unfortunatley that will try and submit the form instead of allowing you to use a javascript function, you should try just putting an href tag around your image:

    <a href=Javascript nclick="yourfunction(); "><img src="yourimage.gif" border=0></a>


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •