javascript - Form submit true when another function true (jquery) -



javascript - Form submit true when another function true (jquery) -

i have form event on submit. submit form when function (first) true.

$("#form_id").submit(function () { if ---------------- { homecoming true; } else { homecoming false; } });

and function:

function (first) { homecoming true }

based on comments, utilize success setting jquery's ajax offers submit().

for example, embody submit() within function:

function sendmystuff(){ $("#form_id").submit(function () { /// }); }

then in ajax's success event, phone call it:

$.ajax({ /// success: sendmystuff });

however, if want way, seek exact opposite of described above. enclose ajax in function returns true, , phone call within submit() event.

edited:

$("#form_id").submit(function (event) { if(somefunction()){ /// } else { /// } event.preventdefault(); });

javascript jquery function

Comments

Popular posts from this blog

php - Android app custom user registration and login with cookie using facebook sdk -

c# - Create a Notification Object (Email or Page) At Run Time -- Dependency Injection or Factory -

Set Up Of Common Name Of SSL Certificate To Protect Plesk Panel -