Web Design & Internet Marketing
Text or Call Now: 813.360.0932

How to confirm before submitting a form with popup box



This will come in handy if you want to confirm before deletion in your web design so you don't accidentally delete items without meaning to. Modify your submit button to this:


<INPUT TYPE='submit' value='Delete' name='delete' onClick='return confirmSubmit()'>


The important part here is the onClick attribute. And then add this somewhere on your page on top of the form:


<script LANGUAGE="JavaScript"> <!-- function confirmSubmit() { var agree=confirm("Are you sure you wish to continue?"); if (agree) return true ; else return false ; } // --> </script>


That should do the trick :)

We thought you might like to see these other posts about web design...

kimfooyoung About The Author
Kim Young is Founder, CEO, and a developer at Foo - a web development company based in Wesley Chapel, Florida. She can also be found on . With over 16 years of experience as a web developer, Kim is excited to share with you tidbits that she has picked up along the way. Kim prioritizes continuing education and out of box thinking in order to bring the most valuable solution to Fooweb's clients.


Let's Do This!

We are so excited to hear more about your organization and chat about how we can drive more traffic your way. Reach out to us now and get a free quote.

Request Pricing Now

web development services© Foo Web Development LLC    Web Design & Development    Serving Clients Worldwide    Client Login   RSS Feed   Feedburner