Hi,
I have a text box that holds floating numbers how do i format it so that the user will not be able to enter values greater than 99.99.
I want to insert a '.' when the length of the textbox is 2.
i tried to do it this way but while clearing the text using back space button it showed problems
//struts text field//
html:text styleId="txtId" property="txt" onkeyup="countC har(this.id)" maxlength="5"
//script code//
[CODE=javascript]function countChar(obj)
if(document.get ElementById(obj ).value.length= =2)
document.getEle mentById(obj).v alue=document.g etElementById(o bj).value+'.';
[/CODE]
thanks
Anil
I have a text box that holds floating numbers how do i format it so that the user will not be able to enter values greater than 99.99.
I want to insert a '.' when the length of the textbox is 2.
i tried to do it this way but while clearing the text using back space button it showed problems
//struts text field//
html:text styleId="txtId" property="txt" onkeyup="countC har(this.id)" maxlength="5"
//script code//
[CODE=javascript]function countChar(obj)
if(document.get ElementById(obj ).value.length= =2)
document.getEle mentById(obj).v alue=document.g etElementById(o bj).value+'.';
[/CODE]
thanks
Anil
Comment