Skip to content Skip to footer

General used form script functions

closeForm():
You can use this function to close the form with a message. Works in asset & action forms.

function on_load(ws)
{

ws.closeForm(JSON.stringify({"t": "Warning","Close": "The form will get closed"}));
 
}

showAlert():
You can use this function to give a pop up message. Works in asset & action forms.

function on_submit(ws)
{
 
ws.showAlert(JSON.stringify({"t": 'Show Alert Function',"m": 'prompt ' + 'Response',"tp": 'Warning'}));
 
}

setGeneralWarning():
You can use this function to give a warning pop up. Used to set warnings in the form. Used mostly in on_submit. Works in asset & action forms.

function on_submit(ws)
{
 
ws.setGeneralWarning(JSON.stringify({"t": 'Warning',"m": 'General warning' + 'On Submit',"tp": 'warning'}));
 
}

setGeneralError():
You can use this function to give an error pop up. Used to set errors in the forms. Used mostly in on_submit. Works in asset & action form. This will prevent you from submitting the form.

function on_submit(ws)
{
 
var val = ws.setGeneralError(JSON.stringify({"t": 'Error',"m": 'prompt ' + 'General Error_On Submit',"tp": 'error'}));
     
}

Was This Article Helpful?

0
0 Comments

There are no comments yet

Leave a comment

Your email address will not be published. Required fields are marked *

Close Bitnami banner
Bitnami