Question
onclick question
Hello Everyone,
I have a question regarding the onclick functionaility. Bascially, I have two different submit links. I have to insert data in different formats based on the link I click. This I am able to do separately. My problem is that I have to do this based on a prior condition. It is basically a entry form, and first I am checking if the form is not for edit purposes. I am doing something like below:
<cfif formedit eq 1>
<input type = "hidden name="editaction" value="edit">
<cfelse>
<input type="hidden" name="addaction" value="add">
<a href="hello.cfm" onClick="addform();return false;" <cfif editaction EQ 1>Save<cfelse>Add New Person.</cfif></a>
Currently I want to add a new link with a slight differently functionaily as add. Is there a way in coldfusion I can detect if whick link has been clicked and based upon that I can take appropriate action? I am not understanding how do i add something like below to the above code
<cfif formedit eq 1>
<input type = "hidden name="editaction" value="edit">
<cfelse>
<input type="hidden" name="addaction" value="add">
<cfelse>
<input type="hidden" name="adddiffaction" value="adddiff">
I hope I explained my question clearly and I would appreciate any hints or tips regarding this.
Thanks.
I have a question regarding the onclick functionaility. Bascially, I have two different submit links. I have to insert data in different formats based on the link I click. This I am able to do separately. My problem is that I have to do this based on a prior condition. It is basically a entry form, and first I am checking if the form is not for edit purposes. I am doing something like below:
<cfif formedit eq 1>
<input type = "hidden name="editaction" value="edit">
<cfelse>
<input type="hidden" name="addaction" value="add">
<a href="hello.cfm" onClick="addform();return false;" <cfif editaction EQ 1>Save<cfelse>Add New Person.</cfif></a>
Currently I want to add a new link with a slight differently functionaily as add. Is there a way in coldfusion I can detect if whick link has been clicked and based upon that I can take appropriate action? I am not understanding how do i add something like below to the above code
<cfif formedit eq 1>
<input type = "hidden name="editaction" value="edit">
<cfelse>
<input type="hidden" name="addaction" value="add">
<cfelse>
<input type="hidden" name="adddiffaction" value="adddiff">
I hope I explained my question clearly and I would appreciate any hints or tips regarding this.
Thanks.
