Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. ASP.NET
  4. ImageButtons

ImageButtons

Scheduled Pinned Locked Moved ASP.NET
javascripttoolshelptutorialquestion
4 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • C Offline
    C Offline
    chitranjan gohil
    wrote on last edited by
    #1

    I want to change the image of an image button on its mouse over event so i have done ImageButton1.Attributes.Add("onmouseover", "javascript:changeImage();") function changeImage() { document.Form1.ImageButton1.ImageUrl='images/update.gif'; } but its givin me a script error. how to do it? Thanx, chitranjan more dash than cash!!!

    H 1 Reply Last reply
    0
    • C chitranjan gohil

      I want to change the image of an image button on its mouse over event so i have done ImageButton1.Attributes.Add("onmouseover", "javascript:changeImage();") function changeImage() { document.Form1.ImageButton1.ImageUrl='images/update.gif'; } but its givin me a script error. how to do it? Thanx, chitranjan more dash than cash!!!

      H Offline
      H Offline
      hemant kaushal
      wrote on last edited by
      #2

      u forgot to type : between javascript and changeImage(); ImageButton1.Attributes.Add("onmouseover", "javascript :changeImage();") function changeImage(){ document.getElementById('ImageButton1').src='Images/SmallCalendar.gif'; } Regards Hemant -- modified at 6:48 Friday 23rd December, 2005

      C 1 Reply Last reply
      0
      • H hemant kaushal

        u forgot to type : between javascript and changeImage(); ImageButton1.Attributes.Add("onmouseover", "javascript :changeImage();") function changeImage(){ document.getElementById('ImageButton1').src='Images/SmallCalendar.gif'; } Regards Hemant -- modified at 6:48 Friday 23rd December, 2005

        C Offline
        C Offline
        chitranjan gohil
        wrote on last edited by
        #3

        actually i must have copied it wrongly.the colon is there.the script is working.i tried it out with an alert.just the problem now is how to change the image url from the script. more dash than cash!!!

        H 1 Reply Last reply
        0
        • C chitranjan gohil

          actually i must have copied it wrongly.the colon is there.the script is working.i tried it out with an alert.just the problem now is how to change the image url from the script. more dash than cash!!!

          H Offline
          H Offline
          hemant kaushal
          wrote on last edited by
          #4

          use this code in your js function use .src insread of .imageurl in my previous reply also i write this function function changeImage(){ document.getElementById('ImageButton1').src='Images/SmallCalendar.gif'; }

          1 Reply Last reply
          0
          Reply
          • Reply as topic
          Log in to reply
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes


          • Login

          • Don't have an account? Register

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • World
          • Users
          • Groups