Hello,
I'm creating a blueprint with a dialog wizard, and I'm trying to use the built in form validation as stated in the documentation.
Using an input field as follow inmy soy template :
<form action="#" method="post" class="aui" id="valid-form">
<fieldset>
<div class="field-group">
<label for="startDate">Start date*</label>
<input id="startDate" class="medium-field aui-date-picker" type="date" name="startDate" data-aui-validation-dateformat="d/m/Y" data-aui-validation-dateformat-msg="This is not a valid date" data-aui-validation-field>
</div>
</form>
In javascript file, I have following code :
Confluence.Blueprint.setWizard('my-package', function(wizard) {
wizard.on("submit.page1Id", validatePage1);
}
From what I understood, my function validatePage1 should not be called, if the form has an invalid field.
I can see the msg near to my field when it is invalid, I can also see the
data-aui-validation-state
attribute which has value invalid in my field, but anyway, if I click on next button on my wizard which has several pages, I end up in my validatePage1 function, and form is still submitted.
What did I do wrong here?
Thx for any help
Michael