I'm trying to validate an email address and then adding it to a multiple selection box. I'm using the QTip and jquery valid to move. Then when press the Add button, the script should be valid and added to the box below. Validation is working fine, but the difficulty is to add the method to the main qTip script to add.
Add Script
$ (document) .ready (function () {$ ("#addButton") Click (function () {var arr = new Array ( ); $ ('# EmailRecipients Options') Each (function () {arr.push ($ (this) .attr ('value')) () () (Var (i {DuplicateFlag = true; break;}} If (duplicate flags) {warning ('sorry ...');} and {$ ('# email reciprocer'). Append ($ ("(>> option>" + $ "('# valid') Val () + "& lt; / option & gt;"));} return false;});});
Since you are able to compare the string, you can tighten your code below. Besides, you would want to change your jacket. Addendum () method to be raw HTML and add e-mail address to the option value.
$ (document) .ready (function () Click {$ ("# addButton") (function () {var email = []; $ ("# email reseller options"). Each (function () {emails.push ($ (this) .val (); );; ($ .inArray ($ ('$ valid'). Val (), email) = -1) {Warning ("sorry ...");} and {$ ('# email resent') .append ("& lt; Option value = '"+ $ (' # valid '). Val () +"'> "+ $ ('# valid'). Val () +" & lt; / Options & gt; ");}});});
Comments
Post a Comment