Click to See Complete Forum and Search --> : next page.
DanUK
06-10-2003, 11:09 AM
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.
Khalid Ali
06-10-2003, 11:18 AM
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.
requestcode
06-10-2003, 11:22 AM
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.
DanUK
06-10-2003, 12:40 PM
ok gotcha. Thanks for the replies guys. I'll just try and tidy it up with some tables or something!
SearedIce
06-10-2003, 05:41 PM
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