Monday, May 20, 2024
 Popular · Latest · Hot · Upcoming
188
rated 0 times [  189] [ 1]  / answers: 1 / hits: 17505  / 11 Years ago, tue, january 21, 2014, 12:00:00

I have an alert script that shows to users who don't have an underscore between the numbers they wrote in the input of the form (e.g 888_1132).



Since I can't remove the 'OK' button from the alert, I want the page to be refreshed when the 'OK' button is clicked.



function myFunction()
{
alert(Click 'OK' to refresh this page);
}


Demo



Can I do that with the alert button? Thanks in advance.


More From » jquery

 Answers
2

As the script will block until the OK is pressed, then simply add location.reload(); below the alert



function myFunction()
{
alert(Click 'OK' and the page will be refreshed);
location.reload();
}

[#73048] Sunday, January 19, 2014, 11 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
alexander

Total Points: 693
Total Questions: 114
Total Answers: 95

Location: Indonesia
Member since Wed, Jul 7, 2021
3 Years ago
;