Make each tab navigator page an independent form

Posted on 2005-04-20
Medium Priority
Last Modified: 2013-12-24

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?

Question by:twistercomputer
  • 2
  • 2
LVL 35

Accepted Solution

mrichmon earned 1000 total points
ID: 13825595
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.
LVL 20

Expert Comment

ID: 13825842
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)

LVL 20

Assisted Solution

trailblazzyr55 earned 1000 total points
ID: 13825868

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">

Author Comment

ID: 13836138
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?
LVL 35

Expert Comment

ID: 13837903
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.

Featured Post

How to Use the Help Bell

Need to boost the visibility of your question for solutions? Use the Experts Exchange Help Bell to confirm priority levels and contact subject-matter experts for question attention.  Check out this how-to article for more information.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

If you don't have the right permissions set for your WordPress location in IIS, you won't be able to perform automatic updates. Here's how to fix the problem.
Lease-to-own eliminates the expenditure of hardware replacement and allows you to pay off the server over time. Usually, this is much cheaper than leasing servers. Think of lease-to-own as credit without interest.
Is your data getting by on basic protection measures? In today’s climate of debilitating malware and ransomware—like WannaCry—that may not be enough. You need to establish more than basics, like a recovery plan that protects both data and endpoints.…
Is your OST file inaccessible, Need to transfer OST file from one computer to another? Want to convert OST file to PST? If the answer to any of the above question is yes, then look no further. With the help of Stellar OST to PST Converter, you can e…
Suggested Courses

839 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question