logo       

OT: Passing JavaScript Vars With Single Quotes In Them: msg#00090

cms.cold-fusion.user.azcfug

Subject: OT: Passing JavaScript Vars With Single Quotes In Them

Hi, all. Please forgive the off-topic question.

On a web form, I offer a pop-up window to perform a search of
establishments in the db. After the search results are returned, a user
can select one --- my javascript function populates the parent form's
field with the name of the selected establishment, and closes the
pop-up window.

I pass the selected value thus (I'm paraphrasing):

<A
href="javascript:SetRolodexEntry('#EstablishmentFullName[CurrentQueryRow]#')">Select</a>

My problem is that if the establishment has an apostrophe in the name
(which some do), the javascript doesn't work because I've got an extra
single quote. Also, while you're at it, what about other funny
characters, like colons, semicolons, and double quotes? I'm sure this
is basic, but I need help! :-)

Here's my javascript function (also paraphrased):

<script language="JavaScript">
function SetRolodexEntry(EstablishmentFullName)
{
if (! opener.closed)
opener.document.MyForm.MyField.value = EstablishmentFullName;
close ();
}
</script>

Thanks for any help, gang...

Judd Miller
Senior Programmer
Vertical Alliance, Inc.
E-Mail: juddmiller@xxxxxxxxxxxxx
Tel: 831-647-1307

__________________________________________________
Do You Yahoo!?
Get Yahoo! Mail ? Free email you can access from anywhere!
http://mail.yahoo.com/





<Prev in Thread] Current Thread [Next in Thread>
Google Custom Search

News | FAQ | advertise