Link to home
Start Free TrialLog in
Avatar of twistercomputer
twistercomputer

asked on

Make each tab navigator page an independent form

Hello,

Im creating a request information form using a flash cfform. I have two seperate forms on two seperate tab pages, with a submit button on each page. The user will only be filling out either one of the forms. Each form has several required fields. The way it is now, if someone clicks submit on one page, it gives errors for not filling in the required information on the other page. Is there a way I can seperate these so that if someone clicks submit on one page, it only submits the info on that page?


Thanks!
ASKER CERTIFIED SOLUTION
Avatar of mrichmon
mrichmon

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of trailblazzyr55
trailblazzyr55

Instead of making two seperate pages, and having two seperate forms, make one form with two regular buttons, define the action in the buttons "onClick" attribute like this...

<input type="button" name="button1"  .....  onclick="this.form.action='youractionpage.cfm?blah=#blah#&blah=#blah#';">
<input type="button" name="button2"  .....  onclick="this.form.action='yourOtherpage.cfm?blah=#blah#&blah=#blah#';">

Form attributes like so... <form name="yourForm" action="" method="post">

This will still give an error if you don't fill out your required fields, but you can submit to different locations this way.
------------------------------------------------------------------------------------------------------------------------------------------------------
Also another idea is to make templates of the forms you want

Say form1 is in myfirstform.cfm -- in your tabbed interface call the template <cfinclude template="myfirstform.cfm">
Say form2 is in mysecondform.cfm --- in your tabbed interface call the template <cfinclude template="mysecondform.cfm">

Then do a cfswitch/case statement to decide which template to use based on which tab you are on.

That would work, wouldn't take much script editing to get there from where you are now and would look the same, only with no errors :o)

~trail
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of twistercomputer

ASKER

Well i was hoping to keep everything just to the one flash cfform. Is it possible to have the page redirect when one of the tabnavigation tabs in the cfform is clicked?  So like have  tab1 and tab2..   tab1 shows form1.  when you click tab2, it reloads the page but with the form2. So basically is there an actionscript i can put on the tab navigator to change url location?
If it is one form then all required fields must be filled out.

You can only have two different sets of required fields validated with 2 different forms.