Jquery-validation: <input type="hidden" name="" value="">

Created on 26 Sep 2018  路  3Comments  路  Source: jquery-validation/jquery-validation

Subject of the issue

Hi,
I have a form with valid fields and I'm submitting.
It automatically adds, by itself, a field ""
and the submit is not submitted. At the next click of course try to submit and find the field added with the unassigned name and generate an error: "has no name assigned". It had never happened before, I do not know if it depends on the update.

Can you help me, please? Thanks a lot.

Your environment

  • version of jquery-validate: ^1.18.0
  • which browser and its version: Chrome 69.0.3497.100 (Official Build) (64-bit)

Steps to reproduce

Expected behaviour

submit

Actual behaviour

error: "has no name assigned"

Most helpful comment

I had the same issue today.

Because of #2193, be sure to check that the debug property is set to false or the submitHandler will never be called.

$('.my-form').validate({
   debug: false,
   // ...
});

All 3 comments

I had the same issue today.

Because of #2193, be sure to check that the debug property is set to false or the submitHandler will never be called.

$('.my-form').validate({
   debug: false,
   // ...
});

oh ok.
It works, great!

thanks a lot.

Hi @Bek81, thanks for opening the issue.

As @rdelafuente mentioned, it was due to a bug fix we did lately that caused your issue. We considered it a bug because the submithandler should never be called in case the developer toggled the debug mode (Otherwise, if you have some ajax calls inside your submithandler, it will be called even if you expected it to do nothing). The hidden input representing the submit button (will have its name and value) will still be injected into the form even if debug is on for debugging purpose.

Also, we did mention the change in our changelog, although it should be a blog post for every release but our time is rather limited to only provide the changelog for now.

I'm going to close this issue as the plugin is working as expected.

Thanks!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

iamandycohen picture iamandycohen  路  5Comments

jzaefferer picture jzaefferer  路  8Comments

nathanl picture nathanl  路  6Comments

gimler picture gimler  路  5Comments

cdog picture cdog  路  8Comments