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

  • Home
  • SEARCH
  • 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 136967
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T07:01:55+00:00 2026-05-11T07:01:55+00:00

I am working on a legacy web application written in VB.NET for ASP.NET 1.1.

  • 0

I am working on a legacy web application written in VB.NET for ASP.NET 1.1. One particular page has a form with a number of fields. In response to a drop-down box changing value, I am clearing a number of fields, resetting a number of drop-down boxes to the first option, and setting them all to ‘disabled’ in the UI. To do this, I’m using jQuery. I add a CSS class to all of these fields, and then my jQuery selector is something like the following: $(‘*.my-css-class’). Here’s some sample code to explain.

var fields = $('*.fields'); if (some_condition) {     fields.val('');     fields.attr('selectedIndex', 0);     fields.attr('disabled', 'disabled'); } 

The UI updates as expected in response to the above js code, but when I post back the page in response to a button click, the original values still persist on the server-side related to these controls. For instance, txtSomething is one of the fields with a CSS class ‘fields’ (so it will get selected by the above jQuery selector). The user types ‘1234’ in this text box and submits the form. Either the same page is posted back to itself retaining its values, or I return to this page and prepopulate the values on the server-side (for example, the user clicks an Edit button on a summary page), so the control txtSomething is initialized on the client with the value ‘1234’. My jQuery code clears the value as far as the user sees it in the UI, and then the user clicks a submit button. If I interrogate the value with a jQuery selector, the value of this field is an empty string. When the page is posted back and I’m stepping through the code (or doing something with the value of this control), it is still ‘1234’.

A very important point to make is that these values are sent back to the browser after being submitted once. So, picture a form being submitted, or any case where these values are bound or set on the server-side and outputted to the browser pre-populated (as opposed to being output to the browser with default or empty values). If I load the page as default (empty text boxes), enter some text, and then trigger the js function to clear these fields, the value I typed never makes it to the server.

  • 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. 2026-05-11T07:01:56+00:00Added an answer on May 11, 2026 at 7:01 am

    why do you need to disable those fields? Disabling controls can make them not post values to the server … at least that is what happens when an asp.net control is disabled server side.

    Update 1: couldn’t take having the doubt if it was only server side, so I looked it up 🙂 http://www.w3.org/TR/html401/interact/forms.html#h-17.12.1 … ‘In this example, the INPUT element is disabled. Therefore, it cannot receive user input nor will its value be submitted with the form.’, so I was right, even when disabling it client side it won’t post the value

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

Sidebar

Ask A Question

Stats

  • Questions 244k
  • Answers 244k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer You should use the action helper broker to retrieve a… May 13, 2026 at 8:08 am
  • Editorial Team
    Editorial Team added an answer You will (probably) run into problems when using string manipulation… May 13, 2026 at 8:08 am
  • Editorial Team
    Editorial Team added an answer It's referred to as an ASP.NET Expression. You can pull… May 13, 2026 at 8:08 am

Related Questions

I am working on a Silverlight application that uses WCF. I need to have
I'm working with a legacy WebLogic application that contains a web-service application and a
I am currently doing some work for a company that runs a legacy web
I have a SOAP web service that is defined contract-first--the request and response xml

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

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.