I have a submit button which is disabled until a user chooses from a select list.
I want to remove the disabled attribute and also add a class so the button becomes the standard button class I use throughout the site, on change of the select list.
I am trying the following:
$(document).ready(
function(){
$('#category').change(
function(){
if ($(this).val()) {
$('input:submit').attr('disabled',false);
$('#btn_show').addClass.attr('button green');
}
});
});
#category is the drop-down id and #btn_show is the button id
The disabled is removed ok but the class not added. Is my logic correct?
Also, is it also possible to change the value of the submit button when this change happens too?