LuluSW Posted June 6, 2017 Report Share Posted June 6, 2017 Caspio minds I have an app that has a javascript validation in the footer of a submission form. It basically prevents someone from making reservations on previous dates. It's something like: if (newdate < newtoday ) { alert("Choose a future date."); } It works fine. However, I just found out that after 3 consecutives tries, the alert message box will come up with a checkbox with this option: "prevent this page from creating additional dialogs" If the user choose to prevent addtional dialogs, this system will bypass my code, and the user will be able to make reservations on past dates. Is there anyway to prevent the alert function to allow users avoiding dialogs? I also tried document.getElementById('msg').innerHTML instead the alert function but it really does not work well. I am using Wordpress and Firefox. Any help will be higly appreciated. Quote Link to comment Share on other sites More sharing options...
Mathilda Posted June 7, 2017 Report Share Posted June 7, 2017 12 hours ago, LuluSW said: Caspio minds I have an app that has a javascript validation in the footer of a submission form. It basically prevents someone from making reservations on previous dates. It's something like: if (newdate < newtoday ) { alert("Choose a future date."); } It works fine. However, I just found out that after 3 consecutives tries, the alert message box will come up with a checkbox with this option: "prevent this page from creating additional dialogs" If the user choose to prevent addtional dialogs, this system will bypass my code, and the user will be able to make reservations on past dates. Is there anyway to prevent the alert function to allow users avoiding dialogs? I also tried document.getElementById('msg').innerHTML instead the alert function but it really does not work well. I am using Wordpress and Firefox. Any help will be higly appreciated. I would recommend using a function with "return false", it won't let submit a form is date is wrong. I created a script for the similar request, you may check it here Hope that helps Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.