BlockCode
BlockCode

Reputation: 31

Run the function of javascript in one time

Hi I have everything fine but little problem is this that functions is running one by one. I want all functions must run at one time here is the code I am using

<form id="payForm" action="address-to-be-licensed.html" method="post" novalidate="novalidate" onsubmit="return (fnamevalidaton() && emailvalidate() && lastnamevalidation())">

Upvotes: 0

Views: 60

Answers (1)

Chamidu Jayaruwan
Chamidu Jayaruwan

Reputation: 357

This will help

<form id="payForm" action="address-to-be-licensed.html" method="post" novalidate="novalidate" onsubmit="return validate()">

<script>
    function validate() {
        var fname = fnamevalidaton();
        var email = emailvalidate();
        var lastname = lastnamevalidation();

        return fname && email && lastname;
    }
</script>

Upvotes: 3

Related Questions