

Knowledge Partner
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
2019-07-22
14:37
218 views
UserApp form field validation without messages
This seems like it should be simple, but I'm drawing a blank here. In a simple PRD form, I want to validate my inputs. If the field is "wrong", I want to error the field, both to highlight the error, and to disable the submission of a form with an error. Seems like form.showError() is a natural fit here, but I do not want it to show a message. So this:
v=field.getValue();
if (v.length == 1) // whatever
{
form.showError(".");
}
else
{
form.clearMessages();
}
works - but with the "Field Name: ." shown at the top of the form. I don't want that. Just invalidate the field. Whatever form.showError() does to invalidate the field, but without the message part.
2 Replies
rrawson

Vice Admiral
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
2019-07-13
09:07
You could try using jQuery to hide the message.


Knowledge Partner
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
2019-07-22
17:57
Possibly. I'm thinking I shouldn't have to hide it. form.showError() is clearly doing three things. It marks the field contents as "invalid" (turns red). It marks the form as "invalid" (blocks Submit). And it displays a message. I want to do only two of those things.
I can disable the Submit button, I know how to do that. It seems like it should be simple, even obvious, how to mark a form field as "invalid".
I can disable the Submit button, I know how to do that. It seems like it should be simple, even obvious, how to mark a form field as "invalid".