How to set Data Input ‘Date’ field as a mandatory field

Is there is an option to set the Data Input ‘Date’ field mandatory in the client?

Is optional? when left unchecked is not making the field mandatory.

Attached the screenshot in the attachments sections.

Attachments:
You must be logged in to view attached files.
Posted: May 25, 2021 at 12:23 pm
Replies: 2
Jun 2, 2021
Posted by Patrick Burma

The optional/required field checks is performed when there is a submit button or some similar action taken that collects all the widget values.

Probably the best thing to do is use the createResponseObject() which can be added to an on click in a button.

https://internal.vantiq.com/docs/system/cbref/index.html#createresponseobject

You could use jQuery or something to draw some redboxes around the required fields with your own data validator like:

if(!page.data.datetime){
$(‘#divid’).css(‘border’, ‘3px solid red’);
} else {
//do the submit actions
}

Jun 3, 2021
Posted by Brett Rudenstein

You want to use page.validate() in your submit action.

For example

if(page.validate()){
console.log(page);

}

 

This will give prompt you like this if the optional fields are left blank. See attachment.

 

 

 

Attachments:
You must be logged in to view attached files.
Viewing 3 posts - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.
© Vantiq 2024 All rights reserved  •  Vantiq Corporation’s Privacy Policy and Cookie Policy