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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

custom tag

Status
Not open for further replies.

newbby

Programmer
Mar 16, 2004
36
0
0
US
All,
Anyone have any ideas to wrapping a custom tag on a javascript event handler. Using CF 6.
eg: If I click on a link/image, the onclick event would trigger the custom tag to fire. If the link is not clicked the custom tag is not triggered.
Thanks
 
Something like this may work for you, this is how I handle edits and such for my admin tools using an onclick handler.

Code:
<cfparam name="yourmode" default="list">
<html>
<head>
<script language="javascript">
	function handle_delete()
	{
		if ( confirm( "Are you sure?" ) )
		{
			document.thisform.yourmode.value = "delete";
			document.thisform.submit();
		}
	}
</script>
</head>
<body>
<cfif yourmode IS "list">
   List Stuff Or Whatever Here
<cfelseif yourmode is "delete">
   Custom Tag Runs Here
</cfif>
	<form name="thisform" action="" method="post">
	   <input type="button" value="Delete" onClick="handle_delete()">
	   <input type="hidden" name="yourmode">
	</form>
</body>
</html>

My website, or a bad habit?
BarSmart
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top