I was writing a very simple function but can't get the if statement to work correctly.
$("#supplyRequestTextbox-clients").live("blur", function() {
var textboxValue = $(this).val().replace(/\d+/g, '').replace(" ", "");
if (textboxValue == "NO ACCOUNT") {
$(".controlBarTextboxNoAccount").fadeIn("fast");
}
});
The value in the input #supplyRequestTextbox-clients represents a client and is organized like this:
id# FirstName LastName email phone
An example: 000001 John Doe [email protected] 123-456-7890
When no account is found, the string appears exactly like this: 000906 NO ACCOUNT
In my function I strip the digits and first space, then check to see if it works in my if statement. I have alerted textboxValue and it is passing correctly, but no matter that textboxValue is, the if statement never fires.