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