Jump to content

Alert function issue


Recommended Posts

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.

Link to comment
Share on other sites

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 :)

Link to comment
Share on other sites

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...