running javascript function on load

Giganews Newsgroups
Subject: running javascript function on load
Posted by:  Sanjay Goel (sanjaygoel@despammed.com)
Date: Wed, 9 Jul 2003

Hi,
I have a input field like this
<input name="To" type="text" class="input" value="<%=toList%>" size="106"
onBlur="validateUser(document.NewCollab.To)">
this calls validateUser() as soon as I update the input field and lose focus
from it.

What I want is that this validateUser() should also be called on the intial
<%=toList%> that I am filling. I tried adding
onLoad="validateUser(document.NewCollab.To)"
but that didn't work.
What should I use ?
TIA
Sanjay

P.S. this toList is actually a variable in my jsp and is dynamic. Hence I
need to call that javascript function

Replies