The setup is:
I am trying to implement ScriptRunner custom Web Item, which launches a dialog with some fields (Implemented as REST end point, which returns corresponding markup) and on clicking some button it posts the values to another REST end point.
The construct itself seems to work. The problem comes, if I try to use validators for the input values. I try to use mechanisms described here: https://docs.atlassian.com/aui/8.6.0/docs/form-validation.html . And I want to define custom validators.
The problem is, that if I try to use `AJS.formValidation.register()`, then I see the error, that AJS.formValidation is undefined.
If I try to include `
I saw, that for normal JIRA plugins to enable this one needs to adjust some XML. But how one can do it with Scriptrunner (if it is possible at all)?
Interestingly, the example from the same page works:
<input id="demo-message-length" class="text" type="text" data-aui-validation-field minlength="10">
But next example does not (none of the two validators work):
<form id="valid-submit-form" class="aui">
<input class="text" type="text" id="input-one" data-aui-validation-field data-aui-validation-required="required">
<input class="text" type="text" id="input-two" data-aui-validation-field data-aui-validation-max="10">
<button class="aui-button" type="submit">Submit</button>
Notice, that for the length - different attribute is used: `data-aui-validation-max="10"` (instead of `minlength="10"` in first example).
If I replace `data-aui-validation-field data-aui-validation-required="required"` with `data-aui-validation-field required="required"`, then validation for "required" field works as expected.
Could someone explain, why is it the case?
Thank you in advance.
Connect with like-minded Atlassian users at free events near you!Find an event
Connect with like-minded Atlassian users at free events near you!
Unfortunately there are no Community Events near you at the moment.Host an event