PDA

View Full Version : Display error message in textfield.



satyas1
10 Mar 2011, 10:46 PM
Hi,

I face problem while displaying error message to a textfield dynamically.

I have a textfield in the form with name "First Name". It is a user registration form.

After user enters all the fields, the following actions should be achieved.

1)If user enters any non-ascii character then "Please use only ASCII characters" message should be displayed.
2)If user enters any symbol or number, then "Please enter a valid name" message should be displayed.

I am not able to get this functionality. Please help. Thanks in advance :) .

Thanks,
Sudarshan.

b_lee
11 Mar 2011, 12:53 AM
nameField.markInvalid('only ascii');

???

satyas1
11 Mar 2011, 1:19 AM
I already tried with that code, but it was not working...

satyas1
11 Mar 2011, 3:24 AM
Hi,

I have made some slight changes and it is working fine. Thanks very much...

Cheers,
Sudarshan.