Hi,
Is it possible to call a javascript function when initializing a value to a text box.
I have a
jsp page that has amounts displayed.
I have a
java variable amount to be displayed in the text box.
<%
String amount = 1000.00; %>
<input type="text" value="<%= amount %>" >
But I want to format the amount when displaying by calling a javascript function some thing like this
<input type="text" value="javascript:formatAmount('<%= amount %>')" >
but obviously, this doesn't work.
I guess an alternate way is to call a method on body onload to populate all the values. But i have a lot of fields that passing all of them as parameter to a function is impossible.
Can you please let me know of a better way?
Thanks,
Raji.