I have here a create account form, beside my User ID field the one with the Sorry, User ID already exists! is an error message generated by AJAX that notifies the user if the user id he entered obviously exists. Username field here also has the same function with User ID. my problem is how can I disable my Create Button if the error message displayed is Sorry, User ID/ Username already Exist? . by the way the message changes into User ID/ Username available otherwise.
Here is my Jquery code
$(document).ready(function()
{
$('#create_btn').hover(function()
{
var id = $('#labeler').val();
var user = $('#labeler2').val();
if((id.indexOf('available') >= 0) && user.indexOf('available') >= 0)
{
$('#create_btn').removeProp('disabled');
}
else
{
$('#create_btn').prop('disabled', true);
}
});
});