Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <html>
- <head>
- <script type="text/javascript">
- function alertbox()
- {
- var test=prompt("Input your name please","")
- if (test!=null && test!="")
- {
- alert("Thanks")
- }
- else if (test==null)
- {
- test2=confirm("You are about to cancel this, press ok to continue, or press cancel to go back and input your name!")
- if (test2==false)
- {
- alertbox()
- }
- }
- else if (test=="")
- {
- alert("Please put a name in the text field!")
- alertbox()
- }
- }
- </script>
- </head>
- <input type="button" onclick="alertbox()" value="Press Me!" />
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement