How to pass the id name to the jQuery validation and send to the controller?

How to pass the id name to the jQuery validation and send to the controller?

I have two anchor tag and on click, I have to get the id value.

I have two anchor tag and on click, I have to get the id value.

so I tried below code and I am getting the id. Now after getting the id, I have to display the popup. so popup is also displaying.

<div class="buttonSet">
  <a href="javascript:void(0);" id="sample1">Sample one</a>
  <a href="javascript:void(0);" id="sample2">Sample two</a>
  </div>

$(".buttonSet a").click(function() {
    alert(this.id);//getting the id name, just for an example
    $('#Popup').show();
});

Popup code is

<div class="" id="Popup" style="display:none">
    <form action="" method="post" name="form1" id="form1" autocomplete="off">
      <div class="form-group ffl-wrapper">
        <label for="name" class="ffl-label">Name</label>
        <input type="text" name="name" class="form-control" id="name">
      </div>

  &lt;div class="form-group ffl-wrapper"&gt;
    &lt;label for="email" class="ffl-label"&gt;Email&lt;/label&gt;
    &lt;input type="email" name="email" class="form-control" id="email"&gt;
  &lt;/div&gt;

  &lt;div class="form-group ffl-wrapper"&gt;
    &lt;label for="mobileno" class="ffl-label"&gt;Mobile Number&lt;/label&gt;
    &lt;input type="text" name="mobileno" class="form-control" id="mobileno"&gt;
  &lt;/div&gt;


  &lt;div class="form-group text-center btn_submit_action"&gt;
    &lt;input type="submit" name="send" class="" value="Submit"&gt;
  &lt;/div&gt;
&lt;/form&gt;

</div>

Now I am confused how do I pass the id value to the jQuery validation and how to submit button will work. I mean I have one form and two buttons. The Same form will open on button click. I have to get the information that which button is clicked and pass that button id to the jQuery validation and send to the form. Because I have to store the name of the button which is clicked.

jQuery validation

$("#form1").validate({
  rules: {
    name: {
      required: true,
      minlength: 3,
      lettersonly: true
    },
    email: {
      required: true,
      email: true
    },
    mobileno: {
      required: true,
      minlength: 10,
      maxlength: 10,
      number: true
    }
  },
  submitHandler: function(form) {
    $.ajax({
      url: "//my url",
      type: "POST",
      data: $('#form1').serialize(),
      success: function(data) {
        $("#Popup").hide();
        $("#popup_success").show();
      },
    }); // AJAX Get Jquery statment
  }
});

Angular 9 Tutorial: Learn to Build a CRUD Angular App Quickly

What's new in Bootstrap 5 and when Bootstrap 5 release date?

Brave, Chrome, Firefox, Opera or Edge: Which is Better and Faster?

How to Build Progressive Web Apps (PWA) using Angular 9

What is new features in Javascript ES2020 ECMAScript 2020

Building a minesweeper game using Javascript, HTML and CSS

In this article, you'll learn how to build minesweeper using JavaScript, HTML and CSS. I also used jQuery, a JavaScript library that is helpful for interacting with html. Whenever you see a function call with a leading dollar sign, that is jQuery at work

Material Login & Signup Form with CSS, HTML and JavaScript

How we can create a login and signup form with the material design using HTML CSS JavaScript? Solution: See this CSS Material Login & Signup Form With jQuery, Material Design Form.

Bar Graphs with Animation using JavaScript, HTML, & CSS

How we can create Bar Graphs With Animation using JavaScript, HTML, & CSS? Solution: JavaScript Animated Bar Graph. In Other Words, Bar Chart With Animation Effects.