perlquestion
peacemaker1820
Hello Monks.
<br>
I have a database of customers and their addresses. Some of the words in my address fields in the database contain apostrophe <b>'</b>.<br>
Now, when i get the address field , i pass it to javascript method for some more work.
here is part of the code:
<code>
# Fetch row
my ( $custno, $companyName, $address, $city, $state, $zip) = $SQL->fetchrow_array();
print <<EndHTML;
<script language="javascript">
fillCustomer('$custno', '$companyName', '$address', '$city', '$state', '$zip');
</script>
EndHTML
</code>
my problem is that it gives me a runtime error when ever my address record contains an apostrophe character (').
My idea is that somehow i need to add an escape character in that record before the apostrophe, but i do not want to do that.
<br>
Any other ideas, guys?
<br>
Greatly appreciated.