in reply to perl and a javascript form field

If you want to have text in a field by default, use the value property. This is a text field that has "hello" in it:

<input type="text" value="hello" />

You don't need any javascript to do that.

If this isn't your problem, well, you've posted an awful lot of javascript code, much of which has not much to do with anything, and not a lot of Perl. If you could just post the code that you need changing/fixing, it would be better.