Why Experts Exchange?

Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.

Jim Murphy
Programmer at Smart IT Solutions

When asked, what has been your best career decision?

Deciding to stick with EE.

Mohamed Asif
Technical Department Head

Being involved with EE helped me to grow personally and professionally.

Carl Webster
CTP, Sr Infrastructure Consultant
Ask ANY Question

Connect with Certified Experts to gain insight and support on specific technology challenges including:

Troubleshooting
Research
Professional Opinions
Ask a Question
Did You Know?

We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE

troubleshooting Question

JQuery Not Working

Avatar of Robert Granlund
Robert GranlundFlag for United States of America asked on
JavaScriptjQuery
5 Comments1 Solution213 ViewsLast Modified:
I have a Wordpress Website that I added the following JQuery to.  It stoped working.  I'm not sure why.  What the script does is stops the Form from submitting if certain form fields have not been filled in and gives a message.  At a glance can anyone say why it may have stopped working?  My thoughts are that it is conflicting with something.

<script type="text/javascript">
	 jQuery(function($) {
	 	jQuery.validator.addMethod(
        "regex",
        function(value, element, regexp) {
            var re = new RegExp(regexp);
            return this.optional(element) || re.test(value);
        },
        "Incorrect format; Please check your input."
);

$.noConflict();
jQuery( document ).ready(function( $ )
		$("#getQuote").validate({
errorElement: 'div',
			rules: {
				bike_value: {
					required: true,
					digits: true
				},
				bike_state: {
					required: true,
					maxlength: 2
				},
				email_value: {
					required: true,
					email: true,
                    regex: "^((\"[\\w\\s-]+\")|([\\w-]+(?:\\.[\\w-]+)*)|(\"[\\w\\s-]+\")([\\w-]+(?:\\.[\\w-]+)*))(@((?:[\\w-]+\\.)*\\w[\\w-]{0,66})\\.([a-zA-Z]{2,6}(?:\\.[a-zA-Z]{2})?)$)|(@\\[?((25[0-5]\\.|2[0-4][0-9]\\.|1[0-9]{2}\\.|[0-9]{1,2}\\.))((25[0-5]|2[0-4][0-9]|1[0-9]{2}|[0-9]{1,2})\\.){2}(25[0-5]|2[0-4][0-9]|1[0-9]{2}|[0-9]{1,2})\\]?$)"
                                          
				}
			},

			messages: {

				bike_value: {
					required: "Please enter the bike value"
				},
				bike_state: {
					required: "Please choose your state"
				},
				email_value: {
                     required: "Please enter an email address",
                     email: "Please enter a valid email address",
                     regex: "Please enter this particular format of email address"
                }		
				
			},
			submitHandler: function(form) {
            form.submit();
        	}
        	
        	
		});

	});
</script>
ASKER CERTIFIED SOLUTION
Avatar of Ahmed Merghani
Ahmed MerghaniFlag of Sudan imageSoftware Engineer

Our community of experts have been thoroughly vetted for their expertise and industry experience.

Commented:
This problem has been solved!
Unlock 1 Answer and 5 Comments.
See Answers