Hi all
I need to allow whitespace in my javascript validation in each word.
I don't know how to do the same can anybody help me.
I have written the javascript, in this code whitespace is not allowing right now
can any body help me regarding this.
here is my code
//
function isCharsInBag (s, bag)
{
var i;
for (i = 0; i < s.length; i++)
{
// Check that current character isn't whitespace.
var c = s.charAt(i);
if (bag.indexOf(c) == -1) return false;
}
return true;
}
if (isWhitespace(document.form1.partno.value))
{
Q += " Supplier Part Number\n";
}
if (!isCharsInBag(document.form1.partno.value, "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz " ))
{
errMesg += " Enter Alpha Numeric Value For Supplier Part Number\n";
}
//
thanks


Reply With Quote


Bookmarks