Skip to Main Content

Java Programming

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Object expected error in java script...

Chanchal WankhadeNov 16 2012 — edited Nov 16 2012
Dear All,

we have Java Struts 1.1...



I am getting "Object Expected" error while processing jsp page.
I want to modify the text field so that only number and one dot(.) should be entered.
I have one function and i am calling it as "onkeypress" event.

Below is the function....
function isNumberKey(evt) 
{ 
alert("here"); 
var charCode; 
clearerror(); 
charCode = (evt.which) ? evt.which : event.keyCode 
alert("here"); 
if (charCode != 46 && charCode > 31 && (charCode < 48 || charCode > 57)) 
{ 
return false; 
} 

return true; 
} 

and below are html tags... 
<td>Total No Of Customers  *</td> 
<td><html:text property="noOfCustomersUnit" onkeypress="return isNumberKey(event)" style="width:160px"/></td> 
Please suggest how to solve the issue....
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Dec 14 2012
Added on Nov 16 2012
1 comment
442 views