Bug Tracker

Opened 11 years ago

Closed 10 years ago

#4145 closed bug (invalid)

[validate] If an issue is fixed just before the submit is clicked the form is not submited

Reported by: logren Owned by:
Priority: major Milestone:
Component: plugin Version:
Keywords: validate Cc:
Blocked by: Blocking:

Description

I need to double click the submit button to submit a form if an error was fixed just before submit.

The onkeyUp event is disabled ("onkeyup:false" in plugin settings).

Let's assume there is an email field and submit button The sequence is as follows:

  1. Put wrong value to email field
  1. Click submit
  1. The error shows up
  1. Correct the value
  1. Click submit
  1. The error disappears, but the form is not sent
  1. Click submit again
  1. The form is sent

What I noticed is that after clicking the button in step (5) the focusout event is trriggered, but there is no click event

Change History (2)

comment:1 Changed 11 years ago by sreichert

I believe I've found a solution for this issue. This also resolves an issue I've noticed where the 2nd field on the form is automatically validated to be false upon initial focus.

In the the validation library, find the onkeyup function assignment, and modify by adding an else condition, so it would look as follows:

onkeyup: function(element) {

if ( element.name in this.submitted
element == this.lastElement ) {

this.element(element);

} else{

if($(element).val() != ){

this.element(element);

}

}

},

Thanks, Shai

comment:2 Changed 10 years ago by dmethvin

Resolution: invalid
Status: newclosed

This is not a jQuery core bug. Please report plugin bugs to the plugin's author, or ask on the jQuery forums. jQuery UI bugs should be reported on the UI bug tracker, http://dev.jqueryui.com .

Note: See TracTickets for help on using tickets.