www.webdeveloper.com
Results 1 to 4 of 4

Thread: Javascript output checkmark

  1. #1
    Join Date
    Feb 2011
    Posts
    10

    Javascript output checkmark

    Hey guys,

    I've written some javascript so that when "onblur" occurs for a textbox, the value in the box is updated to the database. I want to be able to output an image of a checkmark beside the textbox after the update is complete.

    I know where in my code I need to put it, I just don't know how to go about doing it. I'm assuming its related to a <div> tag kind of thing, but not really sure where to go from there...

    Any help is appreciated!
    -IM Greg.

  2. #2
    Join Date
    Aug 2008
    Location
    Phoenix, AZ
    Posts
    84
    Well, what I would do is put in an image after the text box <img src="images/check.jpg" id="chk1" style="display:none;" />

    After you do your add to the database and it's successful, just do a document.getElementById("chk1").style.display="block"; in your javascript. that's about the simplest thing that I can think of/
    Keep your nose to the grindstone, it sharpens your boogers.

  3. #3
    Join Date
    Feb 2011
    Posts
    10
    That worked perfect.

    Way better than how I was trying to do it. I was having javascript add the image after, but it kept on readding every time you went back to it.

    Thanks for the help!
    -IM Greg.

  4. #4
    Join Date
    Aug 2008
    Location
    Phoenix, AZ
    Posts
    84
    No worries, just remember that with images it's easier to have them show up if they are loaded when the rest of the page loads. That's why I like using the style="display:none;" a lot
    Keep your nose to the grindstone, it sharpens your boogers.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

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



Recent Articles