I am using PHP to generate a little javascript for one of my pages. In
short it allows a user to select a value from a list and pop it into a form
field on a seperate page. This works well unless there is a " or ' in the
character string.
<SCRIPT language=JavaSc ript>
function Add_Term(Search Term) {
window.opener.d ocument.advsear ch.name_title.v alue +=
SearchTerm;
window.close();
}
</SCRIPT>
<a href="javascrip t:Add_Term('Thi s will work')">"Amarga Presencia"</a>
<a href="javascrip t:Add_Term('Thi s "won't" work')">"Amarga Presencia"</a>
How do I escape the " and ' characters properly ..? I know this is basic
but I have tried \' and \" and cant think what else to do.
--
NecroJoe
-- US East : KCarpenterRox / Necro / 73
Comment