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

  • Home
  • SEARCH
  • 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 9020521
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T05:02:24+00:00 2026-06-16T05:02:24+00:00

I have a form with the name input field, and it should be unique

  • 0

I have a form with the “name” input field, and it should be unique for the whole application. The check happens via Ajax call when a user tries to save the form. If user leaves the “name” empty and then saves the form, it will be followed by a validation error. After this point, every keystroke for the “name” field will be resulted in Ajax call. How to prevent this?

HTML:

<input type="text" name="name" value="${Name}" />

JS:

var validationParams = {
  rules: {
    name: {
      required: true,
      uniqueName: true
    }
  }
};

...

$.validator.addMethod("uniqueName", uniqueNameFn, 'error msg');

...

saveBtn.on('click', save);

...

function save() {
  templateRegion.find(form).validate(validationParams);
  if (!templateRegion.find(form).valid()) return;

  $.ajax({ ... });
}

// FIRES ON EVERY KEYSTROKE IF 'required' VALIDATION INITIALLY FAILS
function uniqueNameFn(value, elemChanged) {
  $.ajax({ ... });
}
  • 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-16T05:02:25+00:00Added an answer on June 16, 2026 at 5:02 am

    At the end of the day it wasn’t jQuery or JavaScript problem. It was a nested forms situation.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Lets say that you have a following simple application: <form action=helloServlet method=post> Give name:<input
I have a form with two text_fields: <input type=text id=post_name name=post[name] /> <input type=text
Suppose I have a form like this: Name:<input type=text name=xxx id=name/> Type:<select> <option>xx</option> <option>xx</option>
I have the following form: echo $this->Form->input('Person.name'); echo $this->Form->input('Person.phone'); echo $this->Form->input('Person.email'); echo $this->Form->input('Message.0.plainmsg'); echo
I have this form: <tbody> <tr> <th>ID</th> <th>Name</th> <th>Birthdate</th> <th><input type=text autofocus=autofocus name=textinput1/></th> <th><input
I have a number of forms like this: <form class=some-name> <input type=hidden name=bill valueflower
i have done something like this: <form action=validate.php method=get> Id :<input type=text name=pID/><br/><br/> Name
i have my form validated using jQuery and should be submited using ajax the
I have a Javascript function which should update a hidden input field in my
I have a form with an input box where user can specify their names,

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.