Solved
Calling JavaScript Function using href inside a <td ...>
Posted on 2008-10-14
Currently, on one screen , the following code to display the clicked invoice works.
<td class="data"><a href="fin_InvoicePartList.htm?Invnum=<HSM name=Invnbr>&xxDealerCd=<HSM name=xxDealerCd>"><HSM name="Invnbr"></a></td>
<td class="data"><HSM name=DlrOrd></td>
<td class="data"><hsm name=SysOrd></td>
<td class="data"><hsm name=OrdDate></td>
Now, I am working on a different screen which is a window. On that screen, when an invoice is clicked, I want to close the window and go back to the parent fields
To do this, I wrote a javascript function goback as below.
function goback(in1) {
var parent1 = opener.document;
var parentField = parent1.getElementById("Invnum");
parentField.value = in1;
parentField.focus();
window.close();
}
Can I invoke this javascript function inside the href inside a <td> ?
I tried the following two ways but without much success. The code is not even going to the javascript function.
<td class="data" <a href="javascript:goback(<HSM name=Invnbr>)"> <HSM name="Invnbr"></a> </td>
<!-- <td class="data" onclick="goback(<HSM name=Invnbr>)"> <HSM name="Invnbr"> </td> -- >
Please ignore the HSM tag. It is a local middleware thing and I can assure you that it does not interfere wih standard HTML/JavaScript.
Thanks a Lot.