Avatar of Pete Winter
Pete Winter
Flag for United Kingdom of Great Britain and Northern Ireland asked on

formvalidation.io validate form on class click

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

jQueryJavaScript

Avatar of undefined
Last Comment
Leonidas Dosas

8/22/2022 - Mon
ASKER CERTIFIED SOLUTION
Leonidas Dosas

Log in or sign up to see answer
Become an EE member today7-DAY FREE TRIAL
Members can start a 7-Day Free trial then enjoy unlimited access to the platform
Sign up - Free for 7 days
or
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.
Not exactly the question you had in mind?
Sign up for an EE membership and get your own personalized solution. With an EE membership, you can ask unlimited troubleshooting, research, or opinion questions.
ask a question
Pete Winter

ASKER
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?
Pete Winter

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

$( ".csaf-stage1" ).click(function() {
             $("#csaf-form").submit();
      });
Leonidas Dosas

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.
Your help has saved me hundreds of hours of internet surfing.
fblack61