[Javascript] HELP!

Chris Tifer christ at saeweb.com
Tue Feb 24 08:34:30 CST 2004


Correct Tom, as for Matt's suggestion, that would indeed work until you find
someone who puts in a " instead of a '. It SHOULDN'T happen, but might from
time to time. The best best is to definitely escape it.

Chris Tifer
http://emailajoke.com

----- Original Message ----- 
From: "TomMallard" <mallard at serv.net>
To: "[JavaScript List]" <javascript at LaTech.edu>
Sent: Tuesday, February 24, 2004 9:05 AM
Subject: RE: [Javascript] HELP!


> 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
>
>
> _______________________________________________
> Javascript mailing list
> Javascript at LaTech.edu
> https://lists.LaTech.edu/mailman/listinfo/javascript




More information about the Javascript mailing list