Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 2870
  • Last Modified:

check to see if form has been submitted

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
CosmicKoder
Asked:
CosmicKoder
  • 4
  • 3
3 Solutions
 
eszaqCommented:
<CFIF IsDefined("form.fieldnames")></CFIF>
0
 
ZvonkoSystems architectCommented:
Use only the submit button name.
Like this:

<cfif IsDefined("Form.yourButtonName")>Submitted</cfif>
0
 
eszaqCommented:
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
Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

 
ZvonkoSystems architectCommented:
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
 
CosmicKoderAuthor Commented:
yes i agree, i didnt see his post when i assigned the points. Thanks!
0
 
ZvonkoSystems architectCommented:
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
 
eszaqCommented:
Zvonko:
very noble of you, I can only bow. btw i am not he, i'm a girl
0
 
ZvonkoSystems architectCommented:
<|:-)
0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

  • 4
  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now