Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8176423
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T23:10:23+00:00 2026-06-06T23:10:23+00:00

I have a form that contain a submit button. I’m using form.validation plugin I

  • 0

I have a form that contain a submit button. I’m using form.validation plugin

I have already set the rules. It’s ok!

But now I created a link out of form that when the user clicks, i would like to change these rules. Is it possible?

For example:

<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.1/jquery.min.js"></script>
<script type="text/javascript" src="http://ajax.aspnetcdn.com/ajax/jquery.validate/1.9/jquery.validate.js"></script>
<script type="text/javascript">
$().ready(function() {
    $(".myform").validate({
        rules: {
            name: {
                required: true
            },
            email: {
                required: true
            },
        }
    });
});
</script>
<form class="myform">
    Name: <input type="text" name="name">
    Email: <input type="text" name="email">
    Phone: <input type="text" name="phone">
    <input type="submit" value="Send">
</form>
<a href="#">Call me</a>

When the user clicks on “Call me”, the validation would be only the “phone” field.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-06T23:10:24+00:00Added an answer on June 6, 2026 at 11:10 pm

    There is lots wrong with this code both syntactically and structure

    <script type="text/javascript">
    $().ready(function() {
    $(".myform").validate({
        rules: {
            name: {
                required: true
            },
            email: {
                required: true
            },
        }
    });
    });
    </script>
    <form class="myform">
    Name: <input type="text" name="name">
    Email: <input type="text" name="email">
    Phone: <input type="text" name="phone">
    </form>
    <a href="#">Call me</a>
    

    should look more like

    <script type="text/javascript">
    $(document).ready(function() {
    $("#callme").click(function(){
       $(".myform").validate({
        rules: {
            phone: {
                required: true
            }
        /*note the removed ,*/
        }
    });
    });
    $("#submit").click(function(){
    $(".myform").validate({
        rules: {
            name: {
                required: true
            },
            email: {
                required: true
            }
        /*note the removed ,*/
        }
    });
    });
    });
    </script>
    <!-- Your Form must have a method attribute either post or get //-->
    <form class="myform" method="post" action="">
    <label for="name">Name:</label> <input type="text" name="name" id="name">
    <label for="email">Email:</label> <input type="text" name="email" id="email">
    <label for="phone">Phone:</label> <input type="text" name="phone" id="phone">
    <!-- Hide this label with css //-->
    <label for="submit" class="hidden">submit:</label><input type="submit" value="submit" text="submit" id="submit" />
    </form>
    <!-- Link this to another form with new js validation rules //-->
    <a href="#" id="callme">Call me</a>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a simple JSP that contains checkbox and submit button: <form action=MappingSubmit.jsp enctype=multipart/form-data
I have a form that contains a regular link as a submit button. Upon
What I have so far: I have a form in PHP that contain the
I have a form with a textarea that can contain large amounts of content
I have an order form with about 30 text fields that contain numerical values.
I have a form that contains dataGridView, whose coloumn are set to dgrv1.Width =dgrv1.Columns.GetColumnsWidth(DataGridViewElementStates.Visible)+20;
I have a form that contains an html file browse button ( <input type=file
I have a Portlet that contains a form. Now what I want to achieve
I have a web form to submit a new user details. In that for
I have a form that has three submit buttons as follows: <input type=submit name=COMMAND

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.