How to make a popup confirmation when clicking submit

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

User avatar
Lucnet
Forum Commoner
Posts: 61
Joined: Sat Jun 26, 2004 5:28 pm
Location: Alabama
Contact:

Post by Lucnet »

Ok, it is working. I missed one }. Hey since you know how to get the if to work. How hard would it to make the add testimonial and generate code display where the testimonials do when the links are clicked for that.
User avatar
Lucnet
Forum Commoner
Posts: 61
Joined: Sat Jun 26, 2004 5:28 pm
Location: Alabama
Contact:

Post by Lucnet »

Disregard the first msg for minute. I would like to get the rest of the info to appear in the same place that the one we just added. Like when I click approved it will appear at the top like the add testimonial did. How can I get the else if to work with those. I changed all the other pagemessages to a different number like 1-7. But I can't seem to get the else if to work. How would I add the else if?
User avatar
Lucnet
Forum Commoner
Posts: 61
Joined: Sat Jun 26, 2004 5:28 pm
Location: Alabama
Contact:

Post by Lucnet »

Well sorry to post so many but I got the else if to work.

Do I need to post a new thread to get help on this:
Since you know how to get the if to work. How hard would it to make the add testimonial and generate code display where the testimonials do when the links are clicked for that.
User avatar
pickle
Briney Mod
Posts: 6445
Joined: Mon Jan 19, 2004 6:11 pm
Location: 53.01N x 112.48W
Contact:

Post by pickle »

To answer your original question, you can do an "onsubmit" call.

Code: Select all

<html>
  <head>
    <script language = "javascript/css">
      function confirm_form()
      &#123;
        return(confirm('Are you sure you want to submit this form?'));
      &#125;
    </script>
  </head>
  <body>
    <form name = "test_form" method = "POST" action = "$PHP_SELF" onsubmit = "return confirm_form();">
      <input type = "submit" name = "submit_button" value = "test confirmation">
    </form>
  </body>
</html>
Real programmers don't comment their code. If it was hard to write, it should be hard to understand.
User avatar
Lucnet
Forum Commoner
Posts: 61
Joined: Sat Jun 26, 2004 5:28 pm
Location: Alabama
Contact:

Post by Lucnet »

Thanks
Post Reply