开发者

Form not submitted after a second call

开发者 https://www.devze.com 2023-01-10 01:15 出处:网络
I try to submit a form if a condition is not validated. $(\"#support_form\").submit(function() { if($(\"#id_reward\").attr(\'value\')==\"\" && $(\'.reward_item.none.selected\').length==0) {

I try to submit a form if a condition is not validated.

$("#support_form").submit(function() {
  if($("#id_reward").attr('value')=="" && $('.reward_item.none.selected').length==0) {
    alert('problem');
    return false;
  } else {
    alert('valid');
    return true;
  }
});

If my form is valid on the firs开发者_C百科t call, my form is well submitted (redirection to another page)

If my form is not valid the first time, and I correct it then, I see the alert box "valid", but my form is not submitted.

Do you have an idea about this problem ?

0

精彩评论

暂无评论...
验证码 换一张
取 消