need to Confirm while Clicking Check box checked [Resolved]

Posted by Somasundaram under C# on 5/4/2012 | Points: 10 | Views : 7779 | Status : [Member] | Replies : 7
hi..

I Have Checkbox in my application,

On clicking Checkbox i must get Confirm message box,
only if Alert Message box confirmed then only have to proceed with Checked_Changed Event..


If any one have code pls help me




Responses

Posted by: Somasundaram on: 5/15/2012 [Member] Starter | Points: 25

Up
0
Down

Resolved
This is the Script:
<script language="JavaScript" type="text/javascript">  

function ss(ctrl)
{
var checkBox1 = document.getElementById(ctrl.id);
if (confirm('Are you sure want to submit?'))
{
__doPostBack(ctrl.id, '');
}
else
{
return false;
}
}
</script>

In Checkbox call the funtion in onclick:
<asp:CheckBox ID="chkAck" runat="server" Visible="false" Text="Hereby i acknowledge the discussion with the Appraiser"

Font-Bold="true" OnCheckedChanged="chkAck_CheckedChanged" onclick="return ss(this)" />


Somasundaram, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Sakthi.Singaravel on: 5/4/2012 [Member] Silver | Points: 25

Up
0
Down
Refer below link it surely used for u.. it explained with example for how to get response from messagebox..

www.dotnetperls.com/messagebox-show



Regards,
Singaravel M

Somasundaram, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Sakthi.Singaravel on: 5/4/2012 [Member] Silver | Points: 25

Up
0
Down
write ur code checkedChanged event..

i giv algorithm for ur query.
->if checkbox checked=true then msgbox "r u want to uncheck"
{
if msgbox result=true then checkbox checked=false
}
else
{
msgbox "r u want check"
if msgbox result=true then
checkbox checked=false
}

Regards,
Singaravel M

Somasundaram, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Sakthi.Singaravel on: 5/9/2012 [Member] Silver | Points: 25

Up
0
Down
r u got solution...?

Regards,
Singaravel M

Somasundaram, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Sakthi.Singaravel on: 5/11/2012 [Member] Silver | Points: 25

Up
0
Down
please let me know ur feedback..?

Regards,
Singaravel M

Somasundaram, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Somasundaram on: 5/15/2012 [Member] Starter | Points: 25

Up
0
Down
Hi friend,

I didn't try this but i got solution in javascript itself....

anyway thanks for ur reply..

Regards,
Somasundaram

Somasundaram, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Sakthi.Singaravel on: 5/15/2012 [Member] Silver | Points: 25

Up
0
Down
Thank you

Regards,
Singaravel M

Somasundaram, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response