DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

+ Reply to Thread
Results 1 to 2 of 2
  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?



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
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


Top DevX Stories

Easy Web Services with SQL Server 2005 HTTP Endpoints
JavaOne 2005: Java Platform Roadmap Focuses on Ease of Development, Sun Focuses on the "Free" in F.O.S.S.
Wed Yourself to UML with the Power of Associations
Microsoft to Add AJAX Capabilities to ASP.NET
IBM's Cloudscape Versus MySQL


Sponsored Links