Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6588455
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T17:03:01+00:00 2026-05-25T17:03:01+00:00

I have a checkbox on a form: <asp:CheckBox ID=CheckBox1 runat=server Visible=true AutoPostBack=True oncheckedchanged=CheckBox1_CheckedChanged />

  • 0

I have a checkbox on a form:

<asp:CheckBox ID="CheckBox1" runat="server"
Visible="true" AutoPostBack="True" oncheckedchanged="CheckBox1_CheckedChanged" />

It is not firing the below event when I check or uncheck it.

protected void CheckBox1_CheckedChanged(object sender, EventArgs e)
{
    if (CheckBox1.Checked)
    {
        preContactTextBox.Visible = true;
        prePracticeCodeTextBox.Visible = true;            
    }
    else
    {
        preContactTextBox.Visible = false;
        prePracticeCodeTextBox.Visible = false;            
    }
}

It is not entering this event at all. What I am doing wrong?

here’s the complete code:

http://pastebin.com/amQURr91

How can I get it to fire the event?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-25T17:03:01+00:00Added an answer on May 25, 2026 at 5:03 pm

    I think the postback is not firing due to the niceforms plugin you are using. It seems the plugin is overriding the default functionality of the checkbox.

    To test if this is the case trying removing the class="niceform" attribute from your form tag.

    Due to the fact that smartforms override the onclick event, as far as I can tell the only way to resolve this is to modify the source of the niceforms plugin by replacing the inputCheck function with the following. I have tested this and it worked for me.

    function inputCheck(el) { //extend Checkboxes
        el.oldClassName = el.className;
        el.dummy = document.createElement('img');
        el.dummy.src = imagesPath + "0.png";
        if (el.checked) { el.dummy.className = "NFCheck NFh"; }
        else { el.dummy.className = "NFCheck"; }
        el.dummy.ref = el;
        if (isIE == false) { el.dummy.style.left = findPosX(el) + 'px'; el.dummy.style.top = findPosY(el) + 'px'; }
        else { el.dummy.style.left = findPosX(el) + 4 + 'px'; el.dummy.style.top = findPosY(el) + 4 + 'px'; }
        el.dummy.onclick = function () {
            //Set the checked state of the checkbox
            this.ref.checked = this.ref.checked ? false : true;
            //Fire the postback
            this.ref.click();
            if (!this.ref.checked) {
                this.ref.checked = true;
                this.className = "NFCheck NFh";
            }
            else {
                this.ref.checked = false;
                this.className = "NFCheck";
            }
        }
        el.onfocus = function () { this.dummy.className += " NFfocused"; }
        el.onblur = function () { this.dummy.className = this.dummy.className.replace(/ NFfocused/g, ""); }
        el.init = function () {
            this.parentNode.insertBefore(this.dummy, this);
            el.className = "NFhidden";
        }
        el.unload = function () {
            this.parentNode.removeChild(this.dummy);
            this.className = this.oldClassName;
        }
    }
    

    Hope this helps.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a CheckBox on an ASP.NET Content Form like so: <asp:CheckBox runat=server ID=chkTest
I have a checkbox list control on my asp.net web form that I am
I have an ASP.NET web form application that on the server side I need
I have got below ASP html <div id=divCheckAll> <div class=selectall> <input type=checkbox id=chkOperationalUpdate name=chkOperationalUpdate
I have a checkbox that when it is clicked it submits the form to
I have a checkbox with id terms and a submit button in my form
I need to have a checkbox which ajax-submits a form. The following code throws
It's quite common to have a form with a checkbox stating Use foo immediately
I have an HTML form: <form action='process.php' method='post'> <input type='checkbox' name='check_box_1' /> Check me!<br>
Suppose I have the following HTML: <form id=myform> <input type='checkbox' name='foo[]'/> Check 1<br/> <input

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.