I have a email textbox in my web page. When user submits the page I am doing some client side validation using javascript. I can get the value of the textbox and compare it to know if it has any data or not. But in case user enters only blank spaces how will I bypass it.
I am using below mentioned code.
// Check the format of email only if it has some data.
// otherwise no checking is needed.
if ($('#txtEmail').val() != "")
{
// do something
}
Thanks in advance.
if ($('#txtEmail').val().length)this would do too...if ($.trim($('#txtEmail').val()).length)