10-25-2019, 12:54 AM
Trying to check if a field "Last" has numeric characters in field, if so to say so. I tried incorporating some code found on line with mine but getting errors. Can anyone help?
**Below is My Code to test field is blank , this part works ***
Browser("Browser1").Page("page").WebEdit("WebEdit_2").Set datatable("Last")
Dim ValTxt2, objRegEx, colMatches
ValTxt2= Browser("Browser1").Page("page").WebEdit("WebEdit_2").GetROProperty("value")
If ValTxt2="" Then
Browser("Browser2").Page("page2").Output CheckPoint("browser3")
Else
*************************************************
** downloaded code below is giving the trouble when trying to incorporate with top code**
objRegEx.Global = True
objRegEx.Pattern = “[0-9]”
strSearchString = ValTxt2
Set colMatches = objRegEx.Execute(strSearchString)
If colMatches.Count > 0 Then
Wscript.Echo “The following characters are not allowed:”
For Each strMatch in colMatches
Wscript.Echo strMatch.Value
Next
End If
End If
**Below is My Code to test field is blank , this part works ***
Browser("Browser1").Page("page").WebEdit("WebEdit_2").Set datatable("Last")
Dim ValTxt2, objRegEx, colMatches
ValTxt2= Browser("Browser1").Page("page").WebEdit("WebEdit_2").GetROProperty("value")
If ValTxt2="" Then
Browser("Browser2").Page("page2").Output CheckPoint("browser3")
Else
*************************************************
** downloaded code below is giving the trouble when trying to incorporate with top code**
objRegEx.Global = True
objRegEx.Pattern = “[0-9]”
strSearchString = ValTxt2
Set colMatches = objRegEx.Execute(strSearchString)
If colMatches.Count > 0 Then
Wscript.Echo “The following characters are not allowed:”
For Each strMatch in colMatches
Wscript.Echo strMatch.Value
Next
End If
End If