I am new to ColdFusion , so i need so help from all....

I am going to do a form having multiple submit buttons in it .
So how can i know which button was clicked. according to this i want different work...

Like simple i want to do add, sub, mul and div in one form.
I have used 4 submit buttons for this after submiting the page i want to reload that page and do accordingly which button was clicked.

So how can i know which button was clicked.
Please respond me...


<cfif StructKeyExists(form,"submit0">
 //logic here

<cfif StructKeyExists(form,"submit1">
 //logic here

<cfif StructKeyExists(form,"submit2">
 //logic here

<cfif StructKeyExists(form,"submit3">
 //logic here

<input type="submit" name="submit0" value="submit0" />
<input type="submit" name="submit1" value="submit1" />
<input type="submit" name="submit2" value="submit2" />
<input type="submit" name="submit3" value="submit3" />

Try that out?

So how can i know which button was clicked.

Only the button clicked will exist on the action page. If all 4 buttons share the same name, use the button value ie #form.submitButton#


<cfparam name="form.submitButton" default="">
<!--- display selection --->
<cfdump var="#form#">

<form method="post">
<input type="submit" name="submitButton" value="add" />
<input type="submit" name="submitButton" value="divide" />
<input type="submit" name="submitButton" value="multiply" />
<input type="submit" name="submitButton" value="divide" />

Thanks it worked greatly thanks once more.....:)