Madura Harshana Madura Harshana - 9 days ago 6
Javascript Question

How to check a string in JavaScript and return Boolean?

How would I convert the following statements to JavaScript?

Set oTextRange = frmSearch.OrderNumList.createTextRange()
lFound = oTextRange.FindText(aOrderNumList(nI))


lFound
should be a Boolean value.

Answer
var lFound = oTextRange.indexOf(aOrderNumList(nI))!=-1
Comments