Answer the question
In order to leave comments, you need to log in
How to hide from an advanced user the ability to submit an initially hidden form?
Essence of the question: there are several forms that open sequentially upon successful completion of the previous one (fields are sent by AJAX).
I understand that it is possible to add the content of the form using append() when filling out the previous one, but if the user is very smart (or too curious), he can get into the sources, and it’s trivial to transfer my template to html and fill it in, safely skipping n- th number of forms that, in theory, should be filled out by him.
Of course, you can declare a global object and add a field to it, for example:
Somehow I didn’t ask such a question before, but now I thought, how to avoid skipping one or more forms?
All forms are in the same html document and all except the first one have display:none. Accordingly, if the form is successfully filled and the button is pressed, the current form is hidden and the next one is shown. How to avoid the case when the user himself will change display to block?
var Sitename = {}
Sitename.countForm = 0;
$.ajax({
.... ,
success: function() {
Sitename.countForm++;
}
});
document.write(' Теперь придется пере загрузиться ');
Answer the question
In order to leave comments, you need to log in
On the client, no way. Anything can be a client. It is necessary to block the wrong sequence of forms on the server.
There is no point in protecting the frontend, the fact that the form is not visible to the average user is enough.
This is about the same as putting a baby carriage in the entrance in the hope that it will not be stolen.
And try to put an intercom in the entrance in the hope of increasing security.
Professional wheelchair hackers will have an "all-terrain" key and they will open the intercom and enter the entrance.
Security can only be increased in the stroller itself (by fastening it to the pipe with a lock) - analogy:
Checks are needed on the server. Those. do not accept data from the second form, if the flag is not set that the first one has already arrived (or not the flag, just check the presence of data in the database from the result of the first form).
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question