View Single Post
  #1 (permalink)  
Old November 28th, 2005, 10:10 PM
geogomez geogomez is offline
Authorized User
 
Join Date: Nov 2005
Location: , , .
Posts: 11
Thanks: 0
Thanked 1 Time in 1 Post
Default 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>


Reply With Quote