can I write the scriptlet into a function and call it pls respond urgent?

Nitesh Naveen

if (Session.store.length==1)
  Session.store="000" + Session.store
else if (Session.store.length==2)
  Session.store= "00" + Session.store
<script language="javascript">
document.forms[0].storenumber.value = '<%= Session.store %>'; 
should work alright provided storenumber is already defined before this scriptlet. In case the textfield is defined after this scriptlet, then use
<input type="text" value="<%= Session.store %>">
Session should be a default variable I guess (as in JSP). The varibales defined in the page are also accessible anwyahere in the page.