PHP echo and javascript

Soldato
Joined
5 Dec 2003
Posts
2,716
Location
Glasgow
Hey, I have a webpage displaying a table from a database. I am wanting to make one of the fields trigger a javascript function using the two previous fields as its parameters. I am having trouble passing the parameters to the javascript function using PHP as the line is full of quotation characters something like this:

echo '<td><a href="#" onclick=(' . $string1 . ', ' . $string2 . ')>' . $row[field3] . '</a></td>

That's the best I can recall from memory and it throws up a javascript error. Does anyone know how I can do this?
 
Back
Top Bottom