Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Wanet Telecoms Ltd on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Using same check box for both delete and restore operation 1

Status
Not open for further replies.

ashw

MIS
Jun 10, 2002
61
CA
How can we use same checkboxes for both delete and restore operations like we do in hotmail and yahoo trash can. I know we will have to use Javascript, of which I know nothing. So Please help!! Can anyone recommend me a good book for integrating javascript with coldfusion??? I really need that!
 
I think the easiest way to do it is to put 2 submit buttons on your page with each having a specific name attribute - then on your action page, check to find out the value of the submit button and do accordingly:

<input type=&quot;checkbox&quot; name=&quot;msgid&quot; value=&quot;1&quot;> Message 1
<input type=&quot;checkbox&quot; name=&quot;msgid&quot; value=&quot;2&quot;> Message 2

<input type=&quot;submit&quot; name=&quot;cmdDelete&quot; value=&quot;Delete&quot;>
<input type=&quot;submit&quot; name=&quot;cmdMove&quot; value=&quot;Move to Folder&quot;>

Action Page:

<cfif isDefined(&quot;form.cmdDelete&quot;)>
Do delete stuff here
</cfif>

<cfif isDefined(&quot;form.cmdMove&quot;)>
Do Move stuff here
</cfif>

Combining it with some javascript to confirm deletions etc, would make the interface a lot nicer - I am not familiar with a cf specific site, but has a link to a JS-Jive mailing list that has a lot of cf members on it.


Tim P.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top