My question maybe looks awkward. But I strongly need the answer. Assume a form submit like:
<input name="button2" type="submit" class="test" id="button2" value="submit"
onclick="checkSubmitStatus();"/>
When the checkSubmitStatus function is called, the form is not submitted yet, so the form data is not arrived in database in server side yet. How can I make them execute in vice-versa? I mean firstly, the form submits and its data is inserted to the server database and then call that javascript function.
I think you want to give to user some feedback about if data was inserted successfully or not, right? if so, I recomend you to follow different way. Eg.:
Your markup:
Your Code:
});
Considering the page you'll call will return just the message you want to show to the user.
I've not tested the code, but I think it will put you in the right way.