need to Confirm while Clicking Check box checked [Resolved]

Posted by Somasundaram under C# on 5/4/2012 | Points: 10 | Views : 10302 | Status : [Member] | Replies : 2
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: 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

Login to post response