[Javascript] HELP!
TomMallard
mallard at serv.net
Tue Feb 24 08:05:32 CST 2004
It's vbscript...
Escape or double the single quotes found in the name...
Replace(rs("emp_fullname"), "'", "\'") 'shorthand for
rs.fields.item("name").value
or
Replace(rs("emp_fullname"), "'", "''")
This can be done on the client using javascript as well.
hth,
tom mallard
seattle
-----Original Message-----
From: javascript-bounces at LaTech.edu
[mailto:javascript-bounces at LaTech.edu]On Behalf Of Dave Stoltz
Sent: Monday, February 23, 2004 8:29 AM
To: '[JavaScript List]'
Subject: [Javascript] HELP!
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!
_______________________________________________
Javascript mailing list
Javascript at LaTech.edu
https://lists.LaTech.edu/mailman/listinfo/javascript
More information about the Javascript
mailing list