Form Validation not working for Dialog Box fields

Alok Singh September 21, 2015

I am using jquery validation plugin to validate for my fields. It works fine for normal form fields but it fails to validate for Dialog2 form fields.

<script>

    jQuery(document).ready(function() {

        $("#actorform").validate();

    });

</script>
 
<div class="aui-dialog2-content">

    <form class="aui actorform" action="#" name="jiraform" id="actorform" method="post">


        <div class="content">
            <div class="field-group">
                <label for="summary">Actor<span class="aui-icon icon-required">Required</span></label>
                <input type="text" value="" name="actor" id="actor" class="text long-field" data-aui-validation-field data-aui-validation-required="required" required>
            </div>

        </div>
    </form>
</div>

1 answer

1 accepted

1 vote
Answer accepted
josh
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
September 22, 2015

It'd be useful to know the version of AUI you are using (you can check with `AJS.version` in the console)

If you are using AUI <= 5.8, you will need to call `require([aui/form-validaiton])` to have the validation work correctly.

The tags indicate you're looking at version 5.9.0 of the docs, here is a demo of form validation working on that version: http://jsbin.com/yudese/edit?html,js,output

Alok Singh October 1, 2015

Hi Joshua, I followed your jsbin code it works fine when you just use enter button but the moment I add a footer inside the dialog box with submit button it do not validates the field.

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events