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 4606476
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T00:34:14+00:00 2026-05-22T00:34:14+00:00

I am creating a page in asp.net with vb.net and I have a check

  • 0

I am creating a page in asp.net with vb.net and I have a check box that I would like to use to activate four text boxes and a drop down list. I have tried using JavaScript to get this working, but it isn’t working so far. I have tried just activating one text box at this point. Any suggestions?

Here are my different objects:

  • cbPractitioner (check box)
  • txtNPI (text box)
  • txtLicense (text box)
  • txtDEA (text box)
  • txtUpin (text box)
  • ddSpecialty (drop down list)

Here is the Javascript code:

<script type="text/javascript">
    function ToggleTextBox(cbPractitioner, txtNPI) {
        var textbox = document.getElementById(txtNPI);
        if (cbPractitioner.checked) {
            txtNPI.disabled = false;
            txtNPI.value = "";
        }
        else {
            txtNPI.disabled = true;
            txtNPI.value = "";
        }
    }
 </script>

Here is the asp.net code:

<asp:CheckBox ID="cbPractitioner" runat="server" 
                text="This person is a Practitioner" 
                style="font-family: Arial, Helvetica, sans-serif; font-size: small" 
                onclick="ToggleTextBox(this,'txtNPI')" />
<asp:Label ID="lblNPI" runat="server" CssClass="style9" Text="NPI:"></asp:Label>

            &nbsp;

            <asp:TextBox ID="txtNPI" runat="server" Width="165px" style="text align:left" CssClass="style9" 
                    Font-Names="Arial" Font-Size="Small" Enabled="false"></asp:TextBox>

            <br />
            <br />
            <asp:Label ID="lblDEA" runat="server" CssClass="style9" Text="DEA Number:">    </asp:Label>
            &nbsp;
            <asp:TextBox ID="txtDEA" runat="server" style="text-align:left" Font-Names="Arial" 
                    Font-Size="Small" Enabled="false"></asp:TextBox>
            <br />
            <br />
            <span class="style9">

            </span>

        </td>
        <td class="style14" valign="top">

            <asp:Label ID="lblLicense" runat="server" CssClass="style9" 
                Text="License Number:"></asp:Label>
            &nbsp;
            <asp:TextBox ID="txtLicense" runat="server" Font-Names="Arial"  style="text-align:left"
                    Font-Size="Small" Height="20px" Enabled="false"></asp:TextBox>
            <br />
            <br />
            <span class="style9">
            <asp:Label ID="Upin" runat="server" Text="Upin:"></asp:Label>
            &nbsp;
            </span>

            <asp:TextBox ID="txtUpin" runat="server" Width="173px" CssClass="style9" style="text-align:left"
                    Font-Names="Arial" Font-Size="Small" Enabled="false"></asp:TextBox>

        </td>
    </tr>
    <tr>
        <td colspan="2">
            <asp:Label ID="lblSpecialty" runat="server" 
                style="font-family: Arial, Helvetica, sans-serif; font-size: small" 
                Text="Specialty:"></asp:Label>
            <asp:DropDownList ID="ddSpecialty" runat="server" 
                DataSourceID="Practitioner_Specialty" DataTextField="SPEC_TITLE" 
                DataValueField="SPEC_TITLE" Enabled="false">
            </asp:DropDownList>
  • 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-22T00:34:14+00:00Added an answer on May 22, 2026 at 12:34 am

    The problem is that ASP.net textboxes and other controls actually have two IDs: a server-side ID and a client-side ID.

    The server-side ID is the one you specify in the markup with ID='foo' RunAt='server'. You use this ID in all your server-side .net code.

    For client-side code, you must use the client-side ID. The client-side ID is generated from the server-side ID with some characters added to it to make sure it is unique. In order to get the client-side ID in your Javascript, write something like this:

    var cbPractitionerId = ‘<%=cbPractitioner.ClientID %>’;

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

Sidebar

Related Questions

I have a document that my asp.net page is creating and I need to
I'm creating a login page. I want to create ASP.NET TextBox controls that have
I am creating a diagnostic page for ASP.NET and would like to programatically detect
I use Asp.NET Mvc 3 for creating web page and so I detect that
I have an ASP.net page that is creating a service reference to a WCF
i have a small problem, i am creating a edit page in my asp.net
Working inside the context of an ASP.NET application I am creating a page that
I'm thinking of creating a diagnostics page for an ASP.NET app, which would be
I have an ASP.NET page that needs to make calls to multiple web services
I have a Windows-Forms Application that I configured to use with an ASP.NET Service

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.