javascript - jquery, submit form when field loses focus -


field (in this case only one field) loses focus, how can I submit a form?

I tried to do this, but it is not working:

  $ ("form"). Submit ();  

UPDATE

I also forgot that the form was also created with jquery:

  $ ("Div"). Html ('

This is probably why it will not submit, I think that these incidents are not being seen.

Loses the focus of the field when triggering the event's event You can add an event handler to its address You can apply.

  $ ("# field"). Blur (function () {$ ("# form"). Submit ();});  

If there is an ID in the field or other means of easily identifying (which I would recommend), then you can do anything like this:

  $ ("#form: input"). Blur (function () {$ ("# form"). Submit ();});  

Because there is only one field.


Comments

Popular posts from this blog

c# - How to capture HTTP packet with SharpPcap -

jquery - SimpleModal Confirm fails to submit form -

php - Multiple Select with Explode: only returns the word "Array" -