/    Sign up×
Community /Pin to ProfileBookmark

Form Validation Dilemma

My form has a handful of fields that sit it hidden divs or hidden paragraphs. I want to loop through all the select boxes verifying the selectedIndex is not 0 and also loop through the text boxes making sure they are not empty. However, I want to ignore the fields that are currently hidden. Any thoughts?

to post a comment
JavaScript

1 Comments(s)

Copy linkTweet thisAlerts:
@chestertbFeb 06.2007 — That would depend on how you hide or show.

The first thing that springs to mind would be to set a flag for each field, then use those flags in your validation function to decide whether to ignore or not.
×

Success!

Help @betheball 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.4,
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,
)...