Dynamic Javascript Confirm Box from ASP.NET

M

marksommerville

Anybody know how to display a dynamic message in a confirm dialog. I
have 2 check boxes and a button. On button click I want to be able to
display a confirmation dialog depending on whether or not I have the
checkboxes checked. No check = no dialog, check 1 = "Are you sure you
want to delete A?", check 2 = "Are you sure you want to delete A and
B?"
 
S

Steph

Anybody know how to display a dynamic message in a confirm dialog. I
have 2 check boxes and a button. On button click I want to be able to
display a confirmation dialog depending on whether or not I have the
checkboxes checked. No check = no dialog, check 1 = "Are you sure you
want to delete A?", check 2 = "Are you sure you want to delete A and
B?"
your question is not explicit !
yes you have a checkbox, but where ? in a datagridview ? , the page ? ...
you can use ajax tool kit to perform differents controls... or simply :
myconrol.Attribut.Add("onclick",@"if(document.getElementById('"+yourcheckbox.ClientID+@"').checked){
if( confirm('are your sure you want to delete ?'))
{
this.form.submit();//? put your code here... a dopostback ?
}}");
 

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,995
Messages
2,570,230
Members
46,820
Latest member
GilbertoA5

Latest Threads

Top