Possible Duplicate:
Check if textbox has empty value
How do I check if an input value is blank?
I am currently doing:
if($(#inputid).val()=="") {
alert("its blank");
}
Possible Duplicate:
Check if textbox has empty value
How do I check if an input value is blank?
I am currently doing:
if($(#inputid).val()=="") {
alert("its blank");
}
Try quoting your selector string:
if ($("#inputid").val() == "") {
...
You might want to trim to stop whitespace from counting:
if ($.trim($("#inputid").val()) == "") {
...
You can just do:
if (!$('#id').val()) {
//is blank
}