/    Sign up×
Community /Pin to ProfileBookmark

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.

to post a comment
JavaScript

3 Comments(s)

Copy linkTweet thisAlerts:
@beau_kangFeb 24.2011 — 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/
Copy linkTweet thisAlerts:
@ImGregauthorFeb 24.2011 — 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.
Copy linkTweet thisAlerts:
@beau_kangFeb 24.2011 — 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
×

Success!

Help @ImGreg spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.16,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...