/    Sign up×
Community /Pin to ProfileBookmark

validating a form

Hello,
ive been trying to validate a form, that when a field is empty an alert would pop up for me, but i only want this for specific fields, not all the fields on the page.

:rolleyes:

to post a comment
JavaScript

6 Comments(s)

Copy linkTweet thisAlerts:
@CharlesJun 17.2003 — [font=georgia]Post a URL for the page with the form and let us know which fields you want to require.[/font]
Copy linkTweet thisAlerts:
@to_knowauthorJun 17.2003 — im actually using a software called TMS which has a javascript capability, and subject to each field the handler then is used.
Copy linkTweet thisAlerts:
@JustinJun 17.2003 — if(window.document.form_name.form_box.value != ""){whatever you want it to do if it is not empty}

or

if(window.document.form_name.form_box.value== "") {whatever you want it to do if it is empty}

i hope this helps
Copy linkTweet thisAlerts:
@CharlesJun 17.2003 — [font=goergia]Justin's method will not catch fields that have nothing but white space. Dave Clark's method will and as such is a better method to use.[/font]
Copy linkTweet thisAlerts:
@to_knowauthorJun 18.2003 — thanks ? dave for the help, im still putting it together as my Jscript is far from amazing, but im getting there.

And once ive done i'll post for you justin, so if you would like to use it.

Thanks once again.
Copy linkTweet thisAlerts:
@JustinJun 18.2003 — will get cells that have "" nothing as a var it wi;; show up as 'null'.

if you have something in it when it loads, then put that phrais in the quotes and it will check if it is diffrent from its starting value

the otherway is better, but it is much longer
×

Success!

Help @to_know 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 6.17,
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: @nearjob,
tipped: article
amount: 1000 SATS,

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

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