I am trying to if the value of an input box is blank or not by doing the below:
var id = $(this).attr('id').substr(3);
var lengthname = $("#input_name_"+id).val().length;
var lengthrss = $("#input_rss_"+id).val().length;
if (lengthrss!=0 || lengthname!=0)
{
// do something
}
else
{
alert('Values cannot be blank');
}
For some reason it is not doing the OR however if the user enters both values as blanks then the alert comes up??