Forum Moderators: open

Message Too Old, No Replies

greying out submit button if incorrect entries are made

         

franc23

8:57 pm on Jul 17, 2006 (gmt 0)

10+ Year Member



Is there any way the submit button can be greyed out if any incorrect entries are entered into the form fields. Incorrect entries are not what can be rectified with javascript. Say for example, the user enters a name that already exists in the database, then I need the submit button to get greyed out immediately.

This will require proper use of ajax and not just javascript i suppose. Any help is greatly appreciated

garann

8:47 pm on Jul 19, 2006 (gmt 0)

10+ Year Member



This will require proper use of ajax and not just javascript i suppose

I think you answered your own question. :)

What I'd do is start with the submit button disabled. Then, as the user leaves each required field, use AJAX to check that the input is correct. If not, display an error. If so, store a variable or increment a variable or something so that, when a certain list of variables all equal true, or some other condition is met, the submit button becomes enabled.