/    Sign up×
Community /Pin to ProfileBookmark

Validating forms – multiple pages

Hello:

I have a very long form which I split into five pages. The script is written in PHP but I’m using JavaScript to validate the fields. I did place a post with the PHP forum to see if they can help me using PHP code. In the meantime, I’ve had success using JavaScript with my forms. But I’ve run into a problem.

I was able to validate the fields for the first page of the form. I click Submit and go to page 2. On page 2, if I leave a field blank and click Submit, I should receive a message saying field must be filled in, it doesn’t, instead I go to page 3. Apparently, on page 2 and forward I cannot validate the data.

Is there a way to validate a form which spans across multiple pages?

Thank you in advance for all the help.

to post a comment
JavaScript

1 Comments(s)

Copy linkTweet thisAlerts:
@JayMMay 20.2007 — Please post your code where you think it's going wrong.

Generally speaking, you should validate everything on the server and not on the client side. What happens if someone disables javascript? Your validations are worthless!
×

Success!

Help @focus310 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.28,
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,
)...