Page 1 of 1

include() function and javascript

Posted: Thu Jan 15, 2009 2:47 pm
by kea
Trying to accomplish what should be a simple task - onclick event to set textbox value to ''.

Code: Select all

 
<script language="javascript">
    function ClearText(textbox) {
        textbox.value = '';
    }           
</script>
<input type="text" value="Username" id="user" name="user" onclick="ClearText(this);" onfocus="this.value = '';"/>

Works when code is placed directly into page, however when put into an include(textbox.php);, the javascript is getting stripped out of the code. Anyone seen this before?