Last active
January 20, 2016 07:19
-
-
Save farmerbradllc/6706516 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<div class="aui-field-wrapper-content lfr-forms-field-wrapper"> | |
<span class="aui-field aui-field-text aui-w50 aui-w50" id="aui_3_4_0_1_281"> | |
<span class="aui-field-content" id="aui_3_4_0_1_280"> | |
<label class="aui-field-label" for="_20_11040legal-address-city">City | |
<span class="aui-label-required">(Required)</span> | |
</label> | |
<span class="aui-field-element " id="aui_3_4_0_1_279"> | |
<input class="aui-field-input aui-field-input-text" id="_20_11040legal-address-city" name="_20_11040legal-address-city" type="text" value=""> | |
</span> | |
</span> | |
</span> | |
</div> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
AUI().use( | |
'aui-form-validator', | |
'aui-base', | |
function(A) { | |
// set variables | |
var form = A.one('#noaWizardFm'), | |
control = form.one('#noa-wizard-control'), | |
content = form.one('#noa-wizard-content'), | |
required = form.all('.aui-label-required'), | |
sections = form.all('.aui-column-content'), | |
currentIndex = 0; | |
if (form){ | |
var items = form.all('.aui-field-input'); | |
items.each(function(node){ | |
console.log(node.get('name')); | |
}); | |
console.log(form); | |
var rules = { | |
email: { | |
email: true, | |
required: true | |
}, | |
emailConfirmation: { | |
email: true, | |
equalTo: '#email', | |
required: true | |
}, | |
gender: { | |
required: true | |
}, | |
name: { | |
rangeLength: [2, 50], | |
required: true | |
}, | |
url: { | |
url: true | |
} | |
}; | |
var fieldStrings = { | |
email: { | |
required: 'Type your email in this field.' | |
}, | |
gender: { | |
required: 'The gender is required.' | |
}, | |
name: { | |
required: 'Required field with a custom message.' | |
} | |
}; | |
new A.FormValidator( | |
{ | |
boundingBox: form, | |
fieldContainer: '.aui-field', | |
fieldStrings: fieldStrings, | |
rules: rules | |
} | |
); | |
} | |
}); |
marclundgren
commented
Sep 26, 2013
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment