Skip to main content
Inspiring
October 29, 2007
Question

cfform action page

  • October 29, 2007
  • 1 reply
  • 410 views
When I first enter my form, thru a mainmenu, I pass it a url.edit_flag = "No'. When the form is entered (returned) from another form, I pass it a url.edit_flag = "Yes". Basically, what I wan to do is perform an insert in the action page when the form is first enetered (No) and perform an edit/update when the form is returned from another form (Yes).

So if the flag is "yes', I want to perform one action (add) and if the flag is "no" I want to perform another action (edit). This is what I have :

<cfif url.edit_flag is "No">
<cfform action="add_action.cfm" method="post">
<cfelseif url.edit_flag is "Yes">
<cfform action="edit_action.cfm" method="post">
</cfif>

However, it does not like this. I get an errory saying my closing </cfform> needs a starting <cfform>,so it appeears both conditions fail. If I just have one form action, the page works.

Is is possible to do what I am trying to do, and if yes, what am I doing wrong ?
    This topic has been closed for replies.

    1 reply

    Inspiring
    October 29, 2007
    Before you get to your form, use if/else logic to set a variable that indicates what page to which you want to submit your form. Use that variable in the action attribute of your cfform tag.