how do i call ajavscript fucntion from my hyprlink
Printable View
how do i call ajavscript fucntion from my hyprlink
VB Code:
<script language="JavaScript"> function checker(whichform){ var agree=confirm("Are you sure you wish to continue? This\nwill send an email to all Sales Managers!"); if (agree){ document.whichform.submit(); } } </script>
ive manages to call this using a hyperlink:
VB Code:
<a href="javascript:checker('initial');"><font size="2" face="Verdana">Initial Request</font></a>
and i have set up the form to be submited at the bottom of the page
VB Code:
<form action="orion_s004.asp" method="post" name="initial" target="_self"> <input type="hidden" name="F_PROFILE" value="<%response.write V_PROFILE%>"> <input type="hidden" name="F_ACCESS" value="<%response.write V_ACCESS%>"> </form>
this works except its trying to submit a fortm caled whichform, when the whichform is a variable which should read 'initial'. I can send the form nuimber up and do it that way but id like to know why this deosnt work
try:
Code:document.forms(whichform).submit();
thanks, that works great