Mouse rollover on a <INPUT TYPE="IMAGE"> tag


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 2 of 2

Thread: Mouse rollover on a <INPUT TYPE="IMAGE"> tag

  1. #1
    Scott Gines Guest

    Mouse rollover on a <INPUT TYPE="IMAGE"> tag


    I am trying to do a mouse rollover image swap in my form, but I can't seem
    to get the INPUT tag to swap images. This is my code...

    <FORM METHOD="POST" ACTION="http://www.mysite.com">
    ...
    A LOT of form input stuff
    ...
    <INPUT TYPE="IMAGE" SRC="C:\CreateTeam.gif" WIDTH=100 HEIGHT=20 NAME="createTeam"
    onMouseOver="document.createTeam.src='C:\\CreateTeamGlow.gif';" onMouseOut="document.createTeam.src='C:\\CreateTeam.gif';">
    </FORM>

    When I position my mouse over the image, it says document.createTeam is not
    an object. How do I accomplish this?

  2. #2
    Scott Gines Guest

    Re: Mouse rollover on a <INPUT TYPE="IMAGE"> tag


    I answered my own question...but, in case you're wondering, here's how to
    do it...

    <FORM METHOD="POST" NAME="myFormName" ACTION="http://www.mysite.com">
    ...
    A LOT of form input stuff
    ...
    </FORM>
    <A HREF="javascript:myFormName.submit()" onMouseOver="myImg.src='C:\\CreateTeamGlow.gif';"
    onMouseOut="myImg.src='C:\\CreateTeam.gif';"
    <IMG NAME=myImg SRC="C:\CreateTeam.gif" BORDER=0>
    </A>

    "Scott Gines" <nospamscott@impactwd.net> wrote:
    >
    >I am trying to do a mouse rollover image swap in my form, but I can't seem
    >to get the INPUT tag to swap images. This is my code...
    >
    ><FORM METHOD="POST" ACTION="http://www.mysite.com">
    >...
    >A LOT of form input stuff
    >...
    ><INPUT TYPE="IMAGE" SRC="C:\CreateTeam.gif" WIDTH=100 HEIGHT=20 NAME="createTeam"
    >onMouseOver="document.createTeam.src='C:\\CreateTeamGlow.gif';" onMouseOut="document.createTeam.src='C:\\CreateTeam.gif';">
    ></FORM>
    >
    >When I position my mouse over the image, it says document.createTeam is

    not
    >an object. How do I accomplish this?



Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center