Hi:
I have a little custom code (vbscript) for an OnValidate event. It looks like this:
Sub msoxd__IssueReportingDev_DetailedDescription_attr_OnValidate(eventObj)
Dim detDesc
detDesc = XDocument.DOM.selectSingleNode("/dfs:myFields/dfs:dataFields/d:IssueReportingDev/@DetailedDescription").text
if len(detDesc)>=5000 then
dim msg
msg = MsgBox("This field cannot contain more than 5,000 characters. You currently have " & formatnumber(len(detDesc),0) & " characters. Please revise your entry.",16,"Detailed Description is too long")
end if
End Sub
When I preview the form (or fill out the published version) if I put more than 5,000 characters in the field, my message box pops up nicely. I can click OK and go back into my field and revise my entry. However, if still have more than 5,000 characters and tab or click out of the field, my message box pops up (expected behavior), I click OK, and it pops up a second time. I have to click OK again before it goes away and lets me revise my field. Is it my if statement? Or something else? Oh, I am designing in IP 2007 but the people using this will be using IP 2003. Thank you for any help/ideas!
Hilary