Determine Which Link Is Clicked

[Total: 0    Average: 0/5]

This link shows how to determine which link sent a user to a page.

Body Code:

<script>
document.write(">> "+document.location+" <<");
</script>
<HR>
Order: <img onClick="subform('order');"    src="http://www.js-examples.com/data/pic1.gif" alt="See order history"><BR>
History: <img onClick="subform('shipment');" src="http://www.js-examples.com/data/pic2.gif" alt="See shipment history"> 
<HR>
<!--
Of course you would change the action to be your page
-->
<form method="get" name="hist" action="http://www.js-examples.com/" onsubmit="alert(document.hist.butt.value)"> 
<input type="text" name="butt" value=""> 
</form> 
<SCRIPT language="javascript1.1"> 
function subform(temp) { 
alert(temp);
document.hist.butt.value=temp; 
document.hist.submit();
} 
</SCRIPT>

Times Viewed: 1

Leave a Reply

Your email address will not be published. Required fields are marked *