[Javascript] HELP!

Dave Stoltz dstoltz at shh.org
Mon Feb 23 10:28:40 CST 2004


This is killing me...

I have a web page which pops up a small window (another instance of IE)
which is used to lookup a person by Badge Number....It displays there badge
#, and name... When the user clicks on the badge number, it passes the badge
ID, and the name to the previous window, and closes the pop up - pretty easy
stuff...

Here's the code for the pop-up script to do the work:

<script language="JavaScript">
function passiton(myValue,AnotherValue) {
window.opener.form1.UserBadge.value = myValue;
window.opener.form1.UserName.value = AnotherValue;
window.close();
}
</script>

And here is the code for the link to click on and pass the info:
<a
href="javascript:passiton('<%=(rs.Fields.Item("emp_badge").Value)%>','<%=(rs
.Fields.Item("emp_fullname").Value)%>')"><%=(rs.Fields.Item("emp_badge").Val
ue)%></a>

It works wonderfully....the only time it doesn't work, is if the user has an
apostrophe in their name like O'Reilly...when this happens I get a
javascript error...

I understand why it's happening, but I don't know how to fix it....

ANY HELP!?

THANK YOU!




More information about the Javascript mailing list