There is a form form
with input action
, whose value
is an empty string, there is an add
button, on click of which the script is called:
function act2() { //получение формы form.action.value='add'; form.submit(); }
It is necessary to reset the input value to empty.
Navigating to the same page - not an option - causes a number of unnecessary bugs.
Experienced to find an option:
function act2() { //получение формы form.action.value='add'; form.submit(); setTimeout( function(){form.action.value=''; form.submit();}, 100) }
However, there was one BUT. Depending on the server / amount of data in the database / phase of the moon, the number that stands under the timeout required for the functions in it to be executed varies.
There is a suspicion that this is all due to the different processing time of the form server after submit
. Is there any option to check whether the processing of the form has ended with the server and only after that call the functions that are under timeout? Or is there some other option to reset the value of this input
?
UPD: The form should be cleared, of course, after its first sending to the server with a completed action
.
Weblogic server
What and how the "servlet" works - while there is no possibility to track.
form.action.value
before or after submit? What backend are you using? - Stepan Kasyanenko