We help IT Professionals succeed at work.

formvalidation.io validate form on class click

petewinter
petewinter asked
on
1,182 Views
Last Modified: 2017-03-23
I am using this form validation script: http://formvalidation.io/settings/

Can you please help me find how I change my code to submit the form on click of element with the class name of "csaf-stage1".

$(document).ready(function() {
		
	$('#csaf-form').formValidation({
		
		// live: 'enabled', // Default value
		trigger: 'input change keyup',
		fields: {
			default_deposit_amount: {
                validators: {
                    greaterThan: {
                        value: getDepositAmount,
                        message: 'The higher deposit must be 5% or greater'
                    }
                }
            }
        }
				
	}).on('success.form.fv', function(e) {
		
	// success code here
		
    });
				
});

Open in new window

Comment
Watch Question

CERTIFIED EXPERT
Distinguished Expert 2017
Commented:
This problem has been solved!
(Unlock this solution with a 7-day Free Trial)
UNLOCK SOLUTION

Author

Commented:
Thanks, but my form is not validating so I must have done something wrong if you can please check:

http://dev.cmyuk.com/csaf/

JQuery: http://dev.cmyuk.com/csaf/js/csaf.js

I basically want the form to submit when the "Next Step" text or if the "PURCHASE WITH FINANCE - CSAF" bar is clicked. So multiple trigger. Also you will notice the fields have live validation if you type in the loan value field.

Any idea what I am doing wrong?

Author

Commented:
Thanks, but all I need to do was to add the below to my original code.

$( ".csaf-stage1" ).click(function() {
             $("#csaf-form").submit();
      });
CERTIFIED EXPERT
Distinguished Expert 2017

Commented:
I hope that someway I find a solution to your problem. I search a lot your code but my code based at this link.
Thanks a lot.

Gain unlimited access to on-demand training courses with an Experts Exchange subscription.

Get Access
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
Empower Your Career
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

Ask ANY Question

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

  • Troubleshooting
  • Research
  • Professional Opinions