Jun 09, 2011, 6:46 PM
[CLOSED] Trying to flag a form as invalid
Hello,
In my client script I'm trying to mark the containing form of a field invalid with Javascript similar to the following:
Any idea what I'm doing wrong?
Thanks
In my client script I'm trying to mark the containing form of a field invalid with Javascript similar to the following:
var showResultText = function (btn, text) {
var myUserName, msg, myUserNameField, myParent, invalidUserIdMsg, formId;
if (btn === "ok") {
//Do something else
} else {
invalidUserIdMsg = "invalid user";
myUserNameField = eval("ContentPH_txtUserName");
myUserNameField.markInvalid(invalidUserIdMsg);
formId = _frmMain.id;
_frmMain.getForm().markInvalid({ formId : invalidUserIdMsg});
}
}
So the txtUserName gets set as invalid, and that works as expected. I'm not having any luck setting the form as invalid. If I do a _frmMain.getForm().isValid() right after the markInvalid, it says "true."Any idea what I'm doing wrong?
Thanks
Last edited by Daniil; Jun 13, 2011 at 4:00 PM.
Reason: [CLOSED]