Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsGeneralPHPASPPerlColdFusionFlashHTML, CSS, ScriptsBrowsers

Webmaster Forum / ColdFusion / Flash Integration / January 2006



Tip: Looking for answers? Try searching our database.

one flash form, mulitple submit buttons

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
dpinder123 - 22 Sep 2005 20:28 GMT
I'm using the flash form tab navigator in which each tab has a different
function. Each tab has it's own submit button. The application is built into
one form, with several buttons (currently 3). Anytime I press a button on the
the second and third tabs, the app thinks that I'm trying to submit info from
the first tab (insertOrder).

Flash Forms will be the end of me today.

<!---button logic--->

<CFIF IsDefined ("FORM.insertOrder")>
  <cfquery datasource="user" name="orderNumbercheck">
  SELECT fileNumber FROM dbo.mortgageLog WHERE fileNumber='#FORM.fileNumber#'
  </cfquery>
  <cfif orderNumbercheck.RecordCount GT "0">
    <cfset msg2 = URLEncodedFormat("The Order Number
<cfoutput>#FORM.fileNumber#</cfoutput>is taken, please try another")>
    <cflocation url="mortgageLog.cfm?msg2=#msg2#">
    <cfelse>
    <cfquery datasource="datasource" name="insertOrder">
*taken out for the thread*
    </cfquery>
  </cfif>
  <CFELSEIF IsDefined ("FORM.updateOrder")>
  <cfdump var="#form#">
  <CFELSEIF IsDefined ("FORM.searchOrder")>
</CFIF>

<!---buttons--->
Each button has its own name:

<cfinput type="submit" name="insertOrder" value="Submit" id="insertOrder">

<cfinput type="submit" name="updateOrder" value="Update" id="updateOrder">

<cfinput type="submit" name="searchOrder" value="search" id="searchOrder">
Chikowski - 23 Sep 2005 13:58 GMT
When ever a submit button is pressed in a flash form, flash submits all the
data from all the tabs.  What you may need to do is to have an on change of the
tab, call a savecontent and disable all form fields that are not on the current
tab.  I usually make it a habbit to do this all the time so I am not submitting
more info than I need to.
dpinder123 - 23 Sep 2005 22:50 GMT
So, I guess you mean something like the code posted below? Am I correct? Do I
put this after the first tab or on the second tab? I tried on both, it didnt
work for me.

<cfformgroup type="page" label="Current Orders" width="900"
onChange="tabChanging">
<cfsavecontent variable="tabChanging">
if selectedIndex=0
form.fileNumber.enabled="false";
form.dateOrdered.enabled="false";
form.fileName.enabled="false";
form.address.enabled="false";
form.city.enabled="false";
form.state.enabled="false";
form.zip.enabled="false";
form.lender.enabled="false";
form.examiner.enabled="false";
form.notes.enabled="false";
form.dateRecorded.enabled="false";
</cfsavecontent>
Chikowski - 26 Sep 2005 13:58 GMT
What you really want is when you click on the frist tab, all the fields on the
first tab are enabled, the fields second tab and third tab are disabled.  When
you click on the second tab, all the fields on the first and third tab are
disabled, all the fields on the second tab are enabled. So on and so forth.  
Now to enable and disable the fields you need to use this syntax.  

put the cfsavecontent either at the top of the page or include it on another
page.

<cfsavecontent variable="tabChanging">
if (selectedindex==0)
  {
    document.fileNumber.enabled = false;
    document.dateOrdered.enabled = false;
    document.fileName.enabled = false;
    document.address.enabled = false;
    document.city.enabled = false;
    document.state.enabled = false;
    document.zip.enabled = false;
    document.lender.enabled = false;
    document.examiner.enabled = false;
    document.notes.enabled = false;
    document.dateRecorded.enabled = false;
  }
if (selectedindex==1)
  {
    document.fileNumber.enabled = true;
    document.dateOrdered.enabled = true;
    document.fileName.enabled = true;
    document.address.enabled = true;
    document.city.enabled = true;
    document.state.enabled = true;
    document.zip.enabled = true;
    document.lender.enabled = true;
    document.examiner.enabled = true;
    document.notes.enabled = true;
    document.dateRecorded.enabled = true;
  }
</cfsavecontent>

<cfform name="myForm" format="flash">
   <cfformgroup type="tabnavigator" onChange="#tabChanging#">

       <cfformgroup type="page" label="Current Orders" width="900">
       </cfformgroup>

       <cfformgroup type="page" label="Past Orders" width="900">
       </cfformgroup>

   </cfformgroup>
</cfform>
dpinder123 - 26 Sep 2005 15:15 GMT
Thanks for clearing that up for me.

I'm now getting this error when the page loads....

There is no property with the name 'selectedindex'.
Chikowski - 27 Sep 2005 13:48 GMT
Sorry, Forgot.  You cannot use the word "SelectedIndex" as a form variable.  You would have to pass the value of the selected index to a different variable.
dpinder123 - 27 Sep 2005 16:22 GMT
Ok, so what you're saying is this:

selectedIndex is used to number the tabs I have, correct? So, tab # 1 would be
selectedindex="1" and so on.....

I need to declare a variable that passes in the "if" logic:
if (variable==0)

Where "==" is specific to each tab?

so, when the user goes from form to form, the input fields on the other tabs
are disabled; correct?

so, i have to give each tab a selectedIndex number (which number should I
start at? I dont know if it works like arrays...)
and I have to declare a variable.

Right?
Chikowski - 27 Sep 2005 16:52 GMT
I'm sorry, I am totally confuseing you.  Can I send a file to you by way of email?
dpinder123 - 27 Sep 2005 17:39 GMT
Yes, my email address is dpinder (at) titlefocus.com
somethingclever - 11 Nov 2005 15:47 GMT
I have a similar problem, but my solution has always been to just use "button"
instead of "submit" type and use remoting to interact with the server to
update/add/delete data.

the problem is that whenever I have a "required=yes" field, the standard error
doesn't always trigger when the field is left blank. I can't find a way to
trigger it in the actionscript. Any ideas?
dpinder123 - 17 Nov 2005 22:45 GMT
email me at the above address.
sakang - 18 Jan 2006 22:00 GMT
Hi guys,

I am trying to do exactly the same thing with my very long form. I've been
playing with
accordion tabs, button, and flash remoting. however, I haven't been able to
get it working right. Would please share your approaches via disabling tabs
approach and button/remoting approach? You maybe my solution to my problems
I've been frustrated with. I am interested in seeing how to disable the other
tabs OR how to make the button/remoting approach work  with the required fields
as well.

thanks you so much you guys!!!
JennyStarr76 - 27 Jan 2006 16:27 GMT
Originally posted by: Chikowski
If you haven't already, I would take a look at asfusion.com.  They have some
great stuff there.  If you do not find what your looking for there, please give
me your e-mail address so I can send you a file with it all layed out and
explained for you.

Hi Chikowski,

I downloaded the real estate app a month ago and it was a great help, but now
I've gone into multiple grids and multiple buttons which aren't covered in
their example. Can you please send me the e-mail that you sent to dpinder123? I
noticed that when I bind my cfinputs to my 2nd grid, the buttons no longer work
on my 1st tab. Thanks! I appreciate your help. You're a saint! I hope I can
learn enough to actually be of help to someone in the near future.

Thanks again,

Jennifer
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.