Quick question (help me debug a line of javascript)

Discuss all aspects of programming here.

Moderator: The Mod Squad

Quick question (help me debug a line of javascript)

Postby olly » Tue Feb 07, 2006 4:33 am

Hello there. Can anybody tell me whats wrong with this?:

Code: Select all
<input type="button" name="addHeader" value="Add header" onClick="addtext('<span class=\"heade\">Add Header Text Here<\/span>');" />
olly
Green Belt
Green Belt
 
Posts: 222
Joined: Thu Jun 27, 2002 8:11 pm

Postby olly » Tue Feb 07, 2006 4:45 am

Scrap that, just solved the problem like this 8)

Code: Select all
<?php
$addHeaderTag = htmlentities("<span class=\"heade\">Add Header Text Here</span>");
?>

<input type="button" name="addHeader" value="Add header" onClick="addtext('<?php echo "$addHeaderTag" ?>');" />
olly
Green Belt
Green Belt
 
Posts: 222
Joined: Thu Jun 27, 2002 8:11 pm


Return to Programming

Who is online

Users browsing this forum: No registered users and 1 guest