/    Sign up×
Community /Pin to ProfileBookmark

hello.
at the moment I have a form, which has lots of javascript to ‘stop’ it being abused, human input, form validation etc…
at the moment though it’s all on one page.
Is there a way i can seperate it so on one page it would ask for one thing, then a button or something to Next page, and the next …

is there a simple way to do that?
thanks if you can help.

to post a comment
JavaScript

4 Comments(s)

Copy linkTweet thisAlerts:
@Khalid_AliJun 10.2003 — May be not that simple,if you go to next page you can not carry previous pages form objects reference,My guess is you 'd want to forward previous pages info to the next page and then reconstruct it there if needed.
Copy linkTweet thisAlerts:
@requestcodeJun 10.2003 — A simple way no. If you are using only JavaScript you would have to use either cookies to save the data from one page to another or pass it through a URL from one page to the next and then on the last page pull all of it together and submit it. If you have a lot of data to compile then cookies would be the better way. A server side language would be a better option though.
Copy linkTweet thisAlerts:
@DanUKauthorJun 10.2003 — ok gotcha. Thanks for the replies guys. I'll just try and tidy it up with some tables or something!
Copy linkTweet thisAlerts:
@SearedIceJun 10.2003 — you could also make a javascript file for each different set of input tests like

human error test file: errhuman.js

wrong character test file: errcharacter.js

put stuff in these files within a function so they can be specifically called later on

errhuman.js would look like this:

function humantest()

{

...codestuff here

}

then in the <head> code of your html form file do something like this

<script language="javascript" src="errhuman.js"></script>

<script language="javascript" src="errcharacter.js"></script>

and in the function that you have being called (in the javascript of the html form page), say submit(), when the form is being submitted put something like this:

humantest();

chartest();

that should call the correct functions in the correct files...and if it doesn't then let me know because i don't want to trick myself or others anymore :p :p

at the end you should have a file for each group of testing code with .js file extension, a script in the form.html (or whatever page it is that has your form) to call the functions in the files

if anyone thinks i've "gone off the deep end" with this description then please let me know...i havn't been scripting in a couple months so i'm a little (a lot?) dusty...

~John
×

Success!

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

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

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