[Javascript] HELP!

Matt Barton javascript at mattbarton.org
Tue Feb 24 03:43:14 CST 2004


Hi Dave.  Try this:

<!-- *************************** -->
<script language="javascript">
var sBadge = "<%=(rs.Fields.Item("emp_badge").Value)%>";
var sName = "<%=(rs.Fields.Item("emp_fullname").Value)%>";
</script>

<a
onClick="sBadge=passiton(sBadge,sName)"><%=(rs.Fields.Item("emp_badge").Valu
e)%></a>

<!-- *************************** -->

I've no idea what language your <% foo %> tags are in , or what technology
is parsing them out and swaping in data, but you could try something like
that.

Matt

----- Original Message ----- 
From: "Dave Stoltz" <dstoltz at shh.org>
To: "'[JavaScript List]'" <javascript at LaTech.edu>
Sent: Monday, February 23, 2004 4:28 PM
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
>
> --
> This email has been verified as Virus free
> Virus Protection and more available at http://www.plus.net




More information about the Javascript mailing list