/    Sign up×
Community /Pin to ProfileBookmark

show error if incorrect value is entered in textbox

Hi all,

Does anyone know of a place to get a code that looks at what is typed in a textbox and displays a green checkmark or a red x next to the textbox if the value entered is invalid. Eg. if no @ is entered in the email field, a red x would be shown next to the email field. Eg. if a zip code contains letters, a red x would be shown next to the zip code field. Eg. if the email field contains a @ and a period, a green check would be shown next to the email field. Etc. The green check or red x would have to be shown either as the user is typing or after they go to the next field (Blur).

Thanks for any help,
Cedric

to post a comment
JavaScript

1 Comments(s)

Copy linkTweet thisAlerts:
@OfekmeisterOct 05.2010 — I assume incorporated in your error checking function would be a call to another function that merely displays a tiny 12x12 or 16x16 pixel image of a green check mark or a red x. The onchange event is triggered when a field loses focus AND has been changed, while onkeyup is triggered when a key is released. I really enjoy writing code like this for people, but I have a lot of work to do this semester at college. Sorry.
×

Success!

Help @cedric813 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.5,
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: @Yussuf4331,
tipped: article
amount: 1000 SATS,

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

tipper: @Samric24,
tipped: article
amount: 1000 SATS,
)...