titanium-module-validation icon indicating copy to clipboard operation
titanium-module-validation copied to clipboard

Does not work with Alloy

Open wackyapps opened this issue 9 years ago • 2 comments

Hi,

Does this work with Alloy where textfield is defined in XML file?

wackyapps avatar Oct 31 '16 17:10 wackyapps

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.

rohit-khanna avatar Dec 14 '16 08:12 rohit-khanna

Thanks @rohit-khanna 💯

mwfire avatar Dec 15 '16 11:12 mwfire