create a Popup

G

Guest

hey everybody... (hey dr. nick!),

i have a large form and i want people to be able to reset it. i dont,
however, want people to accidentally click the reset button. is it possible
for a very small popup to open and ask if they want to clear the form? is
this possible without being blocked by a popup blocker?
thanks in advance
--
Look Out!

Helter Skelter
Yellow Submarine
Pepperland

PS. Get Back!
 
H

Hans Kesting

hey everybody... (hey dr. nick!),
i have a large form and i want people to be able to reset it. i dont,
however, want people to accidentally click the reset button. is it possible
for a very small popup to open and ask if they want to clear the form? is
this possible without being blocked by a popup blocker?
thanks in advance

In the button's onclick (the *client side* onclick - you need to set it
through the Attributes collection), use this:

if (!confirm('Really reset?')) return false;

some notes:
- don't shorten it to "return confirm('..')", you do *not* want to
return yet if it's ok, because ASP.Net can add it's own javascript
after this (fire validators, start postback)
- don't forget the final ; as this will separate your code from the
auto-generated following code.

Hans Kesting
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,777
Messages
2,569,604
Members
45,226
Latest member
KristanTal

Latest Threads

Top