Answer the question
In order to leave comments, you need to log in
How to make the script submit the form on the fly?
Good evening!
There is a script to send the form to the server:
$(document).ready(function() {
$('#filter').submit(function(){
$.post("url", $("#filter").serialize(), function(response) {
$('#filter').hide('slow');
$('#dle-content').html(response);
});
return false;
});
});
Answer the question
In order to leave comments, you need to log in
Submitting a form on the fly is not a good idea.
Sending can be done by 2 events - changing the contents of the input (change) and clicking the key (keyup).
In order not to strongly force the server, on the client side, you can check for the validity of the data. And only if the data is valid, send. Validity exercise at the same event.
But the question is - did the user really want to send this particular data to the server (rhetorical)?
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question