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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T02:11:56+00:00 2026-06-18T02:11:56+00:00

I am running a c# webpage with html buttoms and am having trouble executing

  • 0

I am running a c# webpage with html buttoms and am having trouble executing the javascript that enables the dropdown and textboxes. They are all predefined as disabled as well as a ssave button as hidden and on button click I call NewType() function and they should be visible and enabled on button click but its not working. The call for visibility none on the save button works but not for the drop down or textboxes.

<script type="text/javascript">

$(document).ready(function() {
    var d = document.getElementById('saveBtn').style.visibility = 'hidden';

});  

    function NewType() {           
            var e = document.getElementById('saveBtn').style.visibility = 'visible';

            var x = document.getElementById('DD').removeAttribute('disabled');

            var a = document.getElementById('txt1').removeAttribute('disabled');

            var b = document.getElementById('txt2').removeAttribute('disabled');

            var c = document.getElementById('txt3').removeAttribute('disabled');                                                     
        };


 <button type="button" onclick="NewType()">Add New</button>
 <button type="button" id="saveBtn">Save</button>

<select ID="DD" runat="server" disabled="disabled"
                            height="30px" style="width: 120px">
                            <option value=""></option>
                            <option value="1">fruit</option>
                            <option value="2">vegetables</option>       
                                <option value="3">Other</option></select>
   <br />
                      <input size="3" type="text" ID="txt1" runat="server" disabled="disabled" /> 
                      <input size="3" type="text" ID="txt2" runat="server" disabled="disabled"/>
                      <input size="4" type="text" ID="txt3" runat="server" disabled="disabled" />
  • 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-06-18T02:11:57+00:00Added an answer on June 18, 2026 at 2:11 am

    If you don’t need it, removing the runat="server" attribute from those elements. Controls that have this attribute may be altered before being written to the page. Removing this will mean they are left alone by .NET.

    On a plain HTML element, removeAttribute should work.

    Here is an example.

    <input id="test" type="text" disabled="disabled" value="Some Value">
    <script>
        document.getElementById('test').removeAttribute('disabled');
    </script>
    

    If you View Source on the page in the browser, you can check to see if .NET has adjusted something, for example the id attribute.

    I have tested removeAttribute in the latest versions of Firefox and Internet Explorer.

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

Sidebar

Related Questions

Can HTML and javascript run offline like an application? I'm looking to running the
I am trying to get a basic webpage up and running that displays the
I have a webpage that looks like: <html> <head> <title>Hi</title> </head> <body> <form name=mainForm
I need to read the in memory HTML of a webpage that is displayed
In IIS 6.0 running on a server 2003 r2 the default webpage can't be
I'm running a web page that has a SL 'box' in it. I know
Running my script through Devel::NYTProf showed that the following portion of code took up
Running SQL Server 2008 (not R2). I have a few reports that have URLs
I am running a typical php-engined ajax webpage. I use echo to return a
I'm trying to finalize my webpage's shopping cart and I'm running into one final

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.