August 12, 201016 yr hey all, I have this code, that says if the document is ready, show submit, once clicked, remove submit and show loading message. then it refreshes the page with thanks message and shows the submit button again. $(document).ready(function() { $('#submit').show(); //hide the submit button after click and shows message $('[id$=submit]').click(function() { $('#loading').show(); $('#submit').hide(); }); }); Problem is that if you click the button with invalid inputs (using live validation) and text areas, it hides it submit and doesn't come back, How do I change it so if basically tell the browser: If input and textarea have the class "valid" then unlock or un-disable submit button, else lock or disable submit button... form is here for verification http://kihonweb.co.uk/get-in-touch.php Thanks
August 12, 201016 yr You definitely need to use hasClass() and attr() methods here . hasClass to check if you input and text area have those classes and attr() to disable and enable submit button.
Create an account or sign in to comment