1.When using on Key Press event:
In the above case the validateInput() is getting called and my alerts also gets prompted as per the conditions BUT STILL if i try to key in alphabets in the text field they are getting keyed in which is not the expected behavior.
So i tried the following property of event object "event.returnValue = false" (for false case).This worked.
So can anybody please explain me what was the issue with former, that is, simply returning false???
2.I have the following things in my html form:
Now i have written a function to feed in the value in Field 2 above dynamically when i click the "Populate" button using the Field 1 value.
In this i am facing the problem : I have limited the maxlength of field to 10. And the value being calculated on click of "populate" button is of length more than 10.So rather than only 10 characters to be shown of the value calculated , it is showing the whole value having length more than 10.This defeats my purpose.
So can anybody please explain me why it is behaving like this and how can i rectify this??
The Art Of Life Is To Know When To Be Useless And When To Be Useful - CHUANG TZU