titanium-module-validation
titanium-module-validation copied to clipboard
Does not work with Alloy
Hi,
Does this work with Alloy where textfield is defined in XML file?
An old post but may be useful for someone.
I tried below and it works well for 'required'. Though not tested for others.
XML:
<TextField id="pin" name="pin" keyboardType= "Ti.UI.KEYBOARD_NUMBER_PAD" rules="required" class="password" />
JS: controller
var validation = require('/lib/de.mwfire.validate');
if (validation.validate([$.pin], {showAlert : true})) { alert('Passed!'); } else { alert('Failed!'); }
I think they all should work.
Thanks @rohit-khanna 💯