Make each tab navigator page an independent form


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?

Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Yes.  Make them separate pages.

This is the only way to do this if using flash forms because by definition a flash form contains the fields from all tabs and all are submitted at once.

So they need to be separate pages.

You can even have them look the same as tabbed navigation (have to write this with normal html cfml - not useing the cfform flash forms) although it seems to me to be a bit of a clunky interface to allow a user to be able to switch between two forms that must be submitted independantly.

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
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)


Would look something like this, of course with your html and all, but this is the idea I think would work for you

<cfswitch expression="#MyTabNumber#">
    <cfcase value="1">
        <cfinclude template="myfirstform.cfm">
    <cfcase value="2">
        <cfinclude template="mysecondform.cfm">
twistercomputerAuthor Commented:
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.
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Web Servers

From novice to tech pro — start learning today.