Solved

check to see if form has been submitted

Posted on 2008-10-20
8
2,666 Views
Last Modified: 2013-12-24
I am using this to check to see if a form has been submitted when using a image as the button for submit

<cfif IsDefined("Form.save.x")></cfif>

It does not work if i am using a standard HTML button for submit

what do i need to use when using a HTML button.

Thanks

Peter
0
Comment
Question by:CosmicKoder
  • 4
  • 3
8 Comments
 
LVL 8

Accepted Solution

by:
eszaq earned 450 total points
ID: 22761956
<CFIF IsDefined("form.fieldnames")></CFIF>
0
 
LVL 63

Assisted Solution

by:Zvonko
Zvonko earned 50 total points
ID: 22761973
Use only the submit button name.
Like this:

<cfif IsDefined("Form.yourButtonName")>Submitted</cfif>
0
 
LVL 8

Assisted Solution

by:eszaq
eszaq earned 450 total points
ID: 22762024
Zvonko:
Sure, specifying submit button name will work, too. Unless there are multiple submit buttons (to possibly define different action to be performed). Using #form.fieldnames# is more generic and will work every time. Just make sure that form method is "post", not "get" (in which case url variable scope will nedd to be used, of course)
0
 
LVL 63

Expert Comment

by:Zvonko
ID: 22762277
Hello CosmicKoder,
sorry but eszaq is right. He proposed before me the better solution.
The FORM.FieldNames is a variable generated by ColdFusion at EVERY form submit with form method set to POST.
If you do agree I can ask Community Support to open this question for new grading.

0
Enterprise Mobility and BYOD For Dummies

Like “For Dummies” books, you can read this in whatever order you choose and learn about mobility and BYOD; and how to put a competitive mobile infrastructure in place. Developed for SMBs and large enterprises alike, you will find helpful use cases, planning, and implementation.

 

Author Comment

by:CosmicKoder
ID: 22762340
yes i agree, i didnt see his post when i assigned the points. Thanks!
0
 
LVL 63

Expert Comment

by:Zvonko
ID: 22768676
Hello CosmicKoder, please note that your Question is now open again.
You can assign the points to eszaq Answer or split the points to all participiants that helped you. It is up to you.

0
 
LVL 8

Expert Comment

by:eszaq
ID: 22769754
Zvonko:
very noble of you, I can only bow. btw i am not he, i'm a girl
0
 
LVL 63

Expert Comment

by:Zvonko
ID: 22772537
<|:-)
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Most ColdFusion developers get confused between the CFSet, Duplicate, and Structcopy methods of copying a Structure, especially which one to use when. This Article will explain the differences in the approaches with examples; therefore, after readin…
Sometimes databases have MILLIONS of records and we need a way to quickly query that table to return the results me need. Sure you could use CFQUERY but it takes too long when there are millions of records. That is why SOLR was invented. Please …
This Micro Tutorial hows how you can integrate  Mac OSX to a Windows Active Directory Domain. Apple has made it easy to allow users to bind their macs to a windows domain with relative ease. The following video show how to bind OSX Mavericks to …
This is used to tweak the memory usage for your computer, it is used for servers more so than workstations but just be careful editing registry settings as it may cause irreversible results. I hold no responsibility for anything you do to the regist…

867 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

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now