Hyper Text Markup Language (HTML) Question:

Download Job Interview Questions and Answers PDF

Can I prevent a form from being submitted again?

HTML Interview Question
HTML Interview Question

Answer:

No. The server-side (e.g., CGI) program that processes the form submission must handle duplicate submissions gracefully.
You could generate the form with a server-side (e.g., CGI) program that adds a hidden field with a unique session ID. Then the server-side program that processes the form submission can check the session ID against a list of previously used session IDs. If the session ID has already been used, then an appropriate action can be taken (e.g., reject the submission, or update the previously submitted data).
Ultimately, your server-side program must be smart enough to handle resubmitted data. But you can avoid getting resubmitted data by not expiring the confirmation page from form submissions. Since you want to expire pages quickly when they have transient data, you might want to avoid putting transient data on the confirmation page. You could provide a link to a database query that returns transient data though.

Download HTML Interview Questions And Answers PDF

Previous QuestionNext Question
How can I specify colors?How can I require that fields be filled in, or filled in correctly?