passing params on an href function call
Hi you all:
I am trying to invoke a function and pass a string parameter using an <a href=... element, but keep getting an error. Passing a number works ok. The parameter data would come from the hidden input field.
Is it a matter of syntax or it cannot be done?
Here is the code:
#65279;<HTML>
<HEAD>
<META http-equiv=Content-Type content="text/html; charset=utf-8">
<META NAME="GENERATOR" Content="Microsoft Visual Studio">
<TITLE>Test</TITLE>
<script language="JavaScript">
function anyFunc(vparam)
{
var oTR=window.document.all.DDTable.insertRow();
var oTD=oTR.insertCell();
oTD.innerText=vparam;
}
</script>
</head>
<BODY>
<input type="hidden" name="hdnName" value="ABC">
<table cellspacing=1 cellpadding=1 width=300 border=1 id="DDTable" >
<tr>
<td><a href='javascript:anyFunc()'>Test data</a></td>
</tr>
</table></BODY></HTML>
|