- Subscribe to RSS Feed
- Mark as New
- Mark as Read
- Bookmark
- Subscribe
- Printer Friendly Page
- Report Inappropriate Content
There is a direct g_form object method which can be used to check if all the mandatory fields on the form are filled/not.
Usually this method wouldn't be much use to you, because submit() function in itself will call this method to check if all the mandatory fields are filled or not.
But this method will be a lifesaver, if you are working for an idea like "draft" in Service Catalog, where you need to make all the mandatory fields on the form non-mandatory, but still track the mandatory fields that weren't filled when the "draft" button is clicked(You need to call this method in draft button, before you make all mandatory fields non mandatory, and hence get all the mandatory fields which are not filled)
var arr = g_form.getMissingFields();
alert("The ID s of fields that are mandatory are not filled : " + arr);
If arr is empty then all the mandatory fields are filled. arr gives a comma separated ids of all the fields that are mandatory and are not filled.
- 9,694 Views
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.