include() function and javascript

Ye' old general discussion board. Basically, for everything that isn't covered elsewhere. Come here to shoot the breeze, shoot your mouth off, or whatever suits your fancy.
This forum is not for asking programming related questions.

Moderator: General Moderators

Post Reply
kea
Forum Newbie
Posts: 1
Joined: Thu Jan 15, 2009 2:43 pm

include() function and javascript

Post 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?
Post Reply