PC Review


Reply
Thread Tools Rate Thread

Adding popup to Checkbox

 
 
tshad
Guest
Posts: n/a
 
      15th Jun 2006
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


 
Reply With Quote
 
 
 
 
tshad
Guest
Posts: n/a
 
      15th Jun 2006
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

"tshad" <(E-Mail Removed)> wrote in message
news:%(E-Mail Removed)...
>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
>



 
Reply With Quote
 
Bob Lehmann
Guest
Posts: n/a
 
      15th Jun 2006
What happens if you use return false, instead of just return?

Bob Lehmann

"tshad" <(E-Mail Removed)> wrote in message
news:%(E-Mail Removed)...
> 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
>
>



 
Reply With Quote
 
Ray Booysen
Guest
Posts: n/a
 
      15th Jun 2006
Is Autopostback set to true for the checkbox?

tshad wrote:
> 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
>
> "tshad" <(E-Mail Removed)> wrote in message
> news:%(E-Mail Removed)...
>> 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
>>

>
>

 
Reply With Quote
 
tshad
Guest
Posts: n/a
 
      15th Jun 2006
"Bob Lehmann" <(E-Mail Removed)> wrote in message
news:%(E-Mail Removed)...
> What happens if you use return false, instead of just return?


That was it.

Thanks,

Tom
>
> Bob Lehmann
>
> "tshad" <(E-Mail Removed)> wrote in message
> news:%(E-Mail Removed)...
>> 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
>>
>>

>
>



 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
CheckBox in PopUp form grayed out rbm Microsoft Access Form Coding 5 30th Dec 2008 09:33 PM
Re: adding a checkbox Bob Phillips Microsoft Excel Misc 1 26th Jan 2007 03:05 PM
Can CheckBox PopUP karpatov Microsoft Excel Programming 0 30th Mar 2006 07:19 PM
.net / checkbox / popup window Rob Meade Microsoft ASP .NET 1 2nd Dec 2005 10:53 AM
Checkbox with dialog popup =?Utf-8?B?am9uLm11bGxpY2hAd2FtdS5uZXQ=?= Microsoft Outlook Form Programming 0 25th May 2005 04:11 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 12:09 AM.