Validating Custom Fields

Validating a Custom Field in the Edit Screen

Main Script

lfInstantHook("textField", "LiveFields/hook.sil"); lfWatch("textField", {"textField"}, "LiveFields/hook.sil", {"keyup"});

Hook Script

if (argv["textField"] == "") {     lfShowFieldMessage("textField", "textField cannot be empty", "ERROR");     lfDisable("editSubmit");     lfDisable("createIssueSubmit"); } else {     lfHideFieldMessage("textField");     lfEnable("editSubmit");     lfEnable("createIssueSubmit"); }

 

Using a Regular Expression for Validation

In the following example, the user must enter an value which matches a social security number.

Main Script

lfInstantHook("textField", "LiveFields/hook.sil"); lfWatch("textField", {"textField"}, "LiveFields/hook.sil", {"keyup"});

Hook Script



 

Additional Help

Need help implementing this script? Talk to me directly to me by clicking on the bot on this page.

Filter by label

There are no items with the selected labels at this time.