|
OT: Passing JavaScript Vars With Single Quotes In Them: msg#00090cms.cold-fusion.user.azcfug
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> |
|---|---|---|
| Previous by Date: | Tucson CFUG Meeting!: 00090, Darcey Spears |
|---|---|
| Next by Date: | Dumb HTML Question: 00090, Judd M. Miller |
| Previous by Thread: | Tucson CFUG Meeting!i: 00090, Darcey Spears |
| Next by Thread: | Dumb HTML Question: 00090, Judd M. Miller |
| Indexes: | [Date] [Thread] [Top] [All Lists] |
| News | FAQ | advertise |