[jQuery] JQuery validation plugin - custom validation for group of html elements
I have a set of combo boxes on a HTML form which act as a Date control: div id=datecheck select id=datecheck_y name=datecheck_y option value=20092009/option option value=20082008/option option value=/option /select select id=datecheck_m name=datecheck_m option value=1Jab/option option value=2Feb/option option value=/option /select select id=datecheck_d name=datecheck_d option value=11/option option value=3131/option option value=/option /select /div No I want to validate whether the user has left any value (year/month/ day) as blank, or if the values form a valid date (example invalid date: 2009(datecheck_y),Feb(datecheck_m),31(datecheck_d) For this I wrote two custom rules in JQuery, here is my approach: I have two custom rules (REQUIRED_DATE, VALID_DATE): $().ready(function() { $.validator.addMethod(REQUIRED_DATE, function(value, element) { CheckBlankDate(element); }, Date cannot be left blank); $.validator.addMethod(VALID_DATE, function(value, element) { return this.optional(element) || CheckDate(element); }, Date should be valid); $(#form1).validate({ rules: { datecheck: { REQUIRED_DATE: true,VALID_DATE: true } }, messages: { datecheck: { REQUIRED_DATE: Date is required, VALID_DATE: Date should be valid } } }); }); Here are the CheckDate, CheckDateBlank JavaScript functions for reference: function ValidateDate(y, mo, d, h, mi, s) { var date = new Date(y, mo - 1, d, h, mi, s, 0); var ny = date.getFullYear(); var nmo = date.getMonth() + 1; var nd = date.getDate(); var nh = date.getHours(); var nmi = date.getMinutes(); var ns = date.getSeconds(); var flag = (ny == y nmo == mo nd == d nh == h nmi == mi ns == s); return (flag); } function CheckDate(dateElement) { var y, mo, d, h, mi, s; y = document.getElementById(dateElement.id + '_y').value; mo = document.getElementById(dateElement.id + '_m').value; d = document.getElementById(dateElement.id + '_d').value; h = document.getElementById(dateElement.id + '_h').value; mi = document.getElementById(dateElement.id + '_min').value; s = 0; return ValidateDate(y, mo, d, h, mi, s); } function CheckBlankDate(dateElement) { var y, mo, d, h, mi, s; y = document.getElementById(dateElement.id + '_y').value; mo = document.getElementById(dateElement.id + '_m').value; d = document.getElementById(dateElement.id + '_d').value; h = document.getElementById(dateElement.id + '_h').value; mi = document.getElementById(dateElement.id + '_min').value; s = 0; if(y== || mo == || d==) { return false; } return true; } This approach does not work, as I believe JQuery cannot find any input element with name datecheck. Is there any other approach that we can follow?
Excellent - Sr. .Net Consultant Available
-> Excellent - Sr. .Net Consultant Available jquery-en -- Thread -- -- Date -- Excellent - Sr. .Net Consultant Available Narasimha Murthy Wed, 10 Sep 2008 06:24:07 -0700 <!-- google_ad_client = "pub-7266757337600734"; google_alternate_ad_url = "http://www.mail-archive.com/blank.png"; google_ad_width = 160; google_ad_height = 600; google_ad_format = "160x600_as"; google_ad_channel = "8427791634"; google_color_border = "FF"; google_color_bg = "FF"; google_color_link = "006792"; google_color_url = "006792"; google_color_text = "00"; //--> Excellent - Sr. .Net Consultant Available Narasimha Murthy Reply via email to
[boston.jobs.com] {-Response-} Excellent - Sr. Actuate Consultant Available
*Excellent - Sr. Actuate Consultant Available* ** Please send your requirements to [EMAIL PROTECTED]http://us.mc464.mail.yahoo.com/mc/[EMAIL PROTECTED] or call at 734-786-3867 for more details. ** *SUMMARY* · *Over 12 years of experience in Software Development Life Cycleusing Analysis, Architecting (Design), Development, Documenting, Testing of various business applications including extensive experience in Web using J2EE platform. Strong exposure in Financial Development Projects with American Express, Citi Group and Times Group.* * Almost 5 years experience in * · *Actuate 7-8, e-Reporting suite, Actuate e. Reporting Server, Actuate e. Report Designer Professional, Actuate Basic, Report Viewer with Oracle 9i, 10g, PL/SQL, SQL Server, Sybase, DB2 UDB (8.1,8.2).* · Wrote stored procedures to incorporate the business logic. Optimised the queries for* t*he application for the batch processes and extracting the MIS information. · *Eclipse BIRT (open source Business Intelligence Reporting Tool) * *Over 4 years experience in all the phases o; var sel_modelo = $('select#modelo_id'); sel_modelo.empty(); for (var i = 0; i json.rs_modelo.length; i++) sel_modelo.append(new Option('text', 'value')); Any hints? Regards, Clodoaldo
[boston.jobs.com] {-Response-} Excellent - Sr. Actuate Consultant Available
Oracle 9i, 8i, 7.x, Sybase SQLAnywhere, FoxPro, 2.5, 2.6, Postgres 8.2 *Web Server *TOMCAT /Apache *Application Server* IBM Web Sphere, Pramati, Oracle Application Server *Development Env.* **Eclipse – RCP, PDE(Plugin development environment) J2EE technologies including J2SE 1.3, JDBC, Servlets, Java Beans, Java Server Pages, EJB, XML, Business Components for Java BC4J (Oracle), OOAD using UML *Designing Tools* UML (Rational Rose), Toad Data Modeller, Eclipse 3.3 *Reporting Tools* Actuate E.R.D Pro – 7,8. *Business Intelligence*MicroStrategy 8.0.2, Eclipse-BIRT 2.2 Thanks and Regards, Samrat Arora Sam netXert Inc. 3915 Research Park Dr Suite A1 Ann Arbor MI 48108 Ph: 734-786-3867, Fax: 734-222-8005 *Email:* [EMAIL PROTECTED]http://us.mc464.mail.yahoo.com/mc/[EMAIL PROTECTED] *Website:* http://www.netxert.com *Yahoo http://www.yahoo.com/ ID:* samnetxert *PeoplePlus* is an efficient, expedient, and effective solution for managing the resourcing process, whether you're looking for permanent recruitment, contract resources, or recruitment through vendors. And once you have a staff, *PeoplePlus* provides an integrated solution to managing contracted and permanent resources. Please visit *http://www.peopleplus.us*http://www.peopleplus.us/ or call us at *734-786-3867* for more information. *Disclaimer :* Netxert,Inc. does not endorse undesired email. Please reply with REMOVE in subject, if you do not want to receive any furtheremail. We apologize for any inconvenience. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Boston Jobs group. To post to this group, send email to Boston-Jobs@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/Boston-Jobs -~--~~~~--~~--~--~---