Advertisement
Guest User

Justin

a guest
Jun 3rd, 2010
306
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <script type="text/javascript">/*<![CDATA[*/
  2. jQuery( document ).ready( function() { jQuery("#form1").validate( {messages:{"special.Hours.FridayHours1.close":{ regExp: "Field has an invalid content" }, "special.Hours.FridayHours1.open":{ regExp: "Field has an invalid content" }, "special.Hours.MondayHours1.close":{ regExp: "Field has an invalid content" }, "special.Hours.MondayHours1.open":{ regExp: "Field has an invalid content" }, "special.Hours.SaturdayHours1.close":{ regExp: "Field has an invalid content" }, "special.Hours.SaturdayHours1.open":{ regExp: "Field has an invalid content" }, "special.Hours.SundayHours1.close":{ regExp: "Field has an invalid content" }, "special.Hours.SundayHours1.open":{ regExp: "Field has an invalid content" }, "special.Hours.ThursdayHours1.close":{ regExp: "Field has an invalid content" }, "special.Hours.ThursdayHours1.open":{ regExp: "Field has an invalid content" }, "special.Hours.TuesdayHours1.close":{ regExp: "Field has an invalid content" }, "special.Hours.TuesdayHours1.open":{ regExp: "Field has an invalid content" }, "special.Hours.WednesdayHours1.close":{ regExp: "Field has an invalid content" }, "special.Hours.WednesdayHours1.open":{ regExp: "Field has an invalid content" }, "special.SpecialType.id":{ required: "This is a required field" }, "special.Text":{ required: "This is a required field" }}, rules:{"special.Hours.FridayHours1.close":{ regExp: /^*(1[0-2]|[1-9]):[0-5][0-9] *(a|p|A|P)(m|M)*$/ }, "special.Hours.FridayHours1.open":{ regExp: /^*(1[0-2]|[1-9]):[0-5][0-9] *(a|p|A|P)(m|M)*$/ }, "special.Hours.MondayHours1.close":{ regExp: /^*(1[0-2]|[1-9]):[0-5][0-9] *(a|p|A|P)(m|M)*$/ }, "special.Hours.MondayHours1.open":{ regExp: /^*(1[0-2]|[1-9]):[0-5][0-9] *(a|p|A|P)(m|M)*$/ }, "special.Hours.SaturdayHours1.close":{ regExp: /^*(1[0-2]|[1-9]):[0-5][0-9] *(a|p|A|P)(m|M)*$/ }, "special.Hours.SaturdayHours1.open":{ regExp: /^*(1[0-2]|[1-9]):[0-5][0-9] *(a|p|A|P)(m|M)*$/ }, "special.Hours.SundayHours1.close":{ regExp: /^*(1[0-2]|[1-9]):[0-5][0-9] *(a|p|A|P)(m|M)*$/ }, "special.Hours.SundayHours1.open":{ regExp: /^*(1[0-2]|[1-9]):[0-5][0-9] *(a|p|A|P)(m|M)*$/ }, "special.Hours.ThursdayHours1.close":{ regExp: /^*(1[0-2]|[1-9]):[0-5][0-9] *(a|p|A|P)(m|M)*$/ }, "special.Hours.ThursdayHours1.open":{ regExp: /^*(1[0-2]|[1-9]):[0-5][0-9] *(a|p|A|P)(m|M)*$/ }, "special.Hours.TuesdayHours1.close":{ regExp: /^*(1[0-2]|[1-9]):[0-5][0-9] *(a|p|A|P)(m|M)*$/ }, "special.Hours.TuesdayHours1.open":{ regExp: /^*(1[0-2]|[1-9]):[0-5][0-9] *(a|p|A|P)(m|M)*$/ }, "special.Hours.WednesdayHours1.close":{ regExp: /^*(1[0-2]|[1-9]):[0-5][0-9] *(a|p|A|P)(m|M)*$/ }, "special.Hours.WednesdayHours1.open":{ regExp: /^*(1[0-2]|[1-9]):[0-5][0-9] *(a|p|A|P)(m|M)*$/ }, "special.SpecialType.id":{ required: true }, "special.Text":{ required: true }}} );
  3. jQuery.validator.addMethod('greaterThan', function(value, element, param) { return ( IsNaN( value ) && IsNaN( jQuery(param).val() ) ) || ( value > jQuery(param).val() ); }, 'Must be greater than {0}.' );
  4. jQuery.validator.addMethod('lesserThan', function(value, element, param) { return ( IsNaN( value ) && IsNaN( jQuery(param).val() ) ) || ( value < jQuery(param).val() ); }, 'Must be lesser than {0}.' );
  5. jQuery.validator.addMethod('notEqualTo', function(value, element, param) { return value != jQuery(param).val(); }, 'Must not be equal to {0}.' );
  6. jQuery.validator.addMethod('regExp', function(value, element, param) { return new RegExp(param).test(value); }, 'Must match expression.' ); });/*]]>*/</script>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement