Adding popup to Checkbox

T

tshad

I use popups periodically to my buttons to prevent actions in my pages.

When I tried this with a checkbox:

DeclineSSN.Attributes.Add("onClick", "if(!confirm('Declining to enter SSN
will prevent the hiring process to continue.\n\n Are you sure you
want Decline?'))return;")

it worked as far as not doing an autopostback if cancel is selected. But the
box still gets selected.

Is there a way to prevent a checkbox from being selected if the Cancel
button is chosen?

Thanks,

Tom
 
T

tshad

I figured out how to get the checkbox to not get selected by changing my
statement like so:

DeclineSSN.Attributes.Add("onClick", "return confirm('Declining to enter SSN
will prevent the hiring process to continue.\n\n Are you sure you
want Decline?');")

But the autopostback doesn't work if I select OK, as it should.

Is there something else I need to make this work?

One of the things I want to do is turn the confirm box off if selecting the
checkbox.

Thanks,

Tom
 
R

Ray Booysen

Is Autopostback set to true for the checkbox?
I figured out how to get the checkbox to not get selected by changing my
statement like so:

DeclineSSN.Attributes.Add("onClick", "return confirm('Declining to enter SSN
will prevent the hiring process to continue.\n\n Are you sure you
want Decline?');")

But the autopostback doesn't work if I select OK, as it should.

Is there something else I need to make this work?

One of the things I want to do is turn the confirm box off if selecting the
checkbox.

Thanks,

Tom
 

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

No members online now.

Forum statistics

Threads
474,431
Messages
2,571,677
Members
48,796
Latest member
Greg L.

Latest Threads

Top