Hi,
one way without the need to use javascript at all. So you want to have a tabbed form. Let's say you use inputs of type image for the tab headers/titles that allow users to switch tabs. Additionally, have some buttons/images on the end of the form to submit and navigate forward/backward.
a) give the tab header submit images different values like
<input type="image" name="tabbutton" value="1" .... />
<input type="image" name="tabbutton" value="2" .... />
and so on. On the active tab just use an image instead of an image input. In each form add a hidden input containing the active tab, e.g.
<input type="hidden" name="activetab" value="1" />
And have three image inputs or buttons at the bottom of the page called e.g. back, submit and forward.
Let's say you're on tab1:
Someone clicks on the tab2 header. The form will be submitted and you'll have
$POST['tabbutton'] = 2;
$POST['activetab'] = 1;
You then know that someone submitted tab1 and wants to switch to tab2. You can then do some form validation on the data submitted and stay on tab1 if something is wrong or save the submitted data in a session and switch to tab2.
Just the same with back,submit and forward.
If someone clicks on submit on any tab you can check the data stored in the session and the data coming from the tab submitted. Let's say someone clicks submit on tab4 and your form validation function(s) returns missing data for tab1 you can display tab1 with appropriate error messages and so on.
You could also decide to implement the logic in a way like:
a) don't validate form data as long as someone switches between tabs by clicking on the different tab headers so users can switch between tabs to fill in the data without validation until they decide they're finished.
b) validate the form data each time a user wants to switch tabs with the back/forward buttons.
c) validate the form data as soon as submit is clicked.
Just some ideas ... there are many ways.
Thomas