views:

37

answers:

2

Hi,
I use CGI::Ajax to check password on blur event of Password textbox field and disabled the submit button (by defualt submit button is active) if current password is wrong using jquery $('#submit_btn').attr('disabled'); It's working fine for me.

But when user enter wrong password and click on Submit button directly without using tab key. It's not disabled the submit sometimes..

So Pls give any idea to solve this problem..

Thnx in advance...

A: 

do not disable your button when password is wrong, but enable it if password is ok. ie : default button state is disable. Becomes active if password field is ok

benzebuth
I can't set default state is disable for button bcoz user can change his Email without using password. if he want to change password then he need to provide current password.
so you should check password when usre click your button. The button should be of type "button" not "input".When you click on it, check the params of your form (password, and even others if you like, like email syntax) and submit your form only if params are good
benzebuth
+1  A: 

Check the password when "onclick" event on the submit button.

M42