Bug Report B202968
Visible to All Users
Duplicate

We have closed this ticket because another page addresses its subject:

ASPxTextBox ClientEnabled="false" loses value after postback

ASPxTextBox - Text set by the SetText method is not persisted on postbacks if the text box is disabled

created 14 years ago

I do the following in javascript on this page: http://new.boemarine.com
txtShippingStreet.SetText(txtStreetAddress.GetText());
It sets it on the screen.
But if you hit submit request it validates and the fields are blank in the shipping address if you check off same as billing after filling in your billing address.
It should keep that value and post it back but it isn't.
What am I doing wrong? Or is this a bug?

Show previous comments (6)
DevExpress Support Team 14 years ago

    Hello James,
    Thank you for your clarification. I have discussed the described scenario with our developers. When you submit a form to the server, the "disabled" inputs value is not posted. If a control is disabled, its value should not be changed in any way. Otherwise, it should be enabled. Such behavior is common for our controls. Please take a look at the ASPxTextBox ClientEnabled="false" loses value after postback thread where we discussed a similar question in detail.
    It is possible to use the ASPxHiddenField control to pass values of disabled editors to the server as a workaround.
    Since in your scenario the disabled ASPxTextBox.Text property is equal to the enabled ASPxTextBox, it is possible to validate the enabled editor value and avoid sending duplicate data to the server.
    We apologize for not being helpful this time. If you have any other questions, please contact us at any time.
    Thanks,
    Jenny

      That's just silly. I should be able to get the current value of the fields any time I want just like I would be able to with the default textbox control and any winforms controls.
      Disabled means that it's disabled for the end user. It doesn't mean that it's disabled for use to the developer, which is what you've done.
      Again, just silly. Please fix what is obviously a bug.

      DevExpress Support Team 14 years ago

        Dear James,
        We understand your position and concerns caused by this behavior. Still, we do not agree that it is a bug. The ASPxClientEditBase.SetEnabled method manipulates the standard HTML <input> "disabled" attribute. HTML elements with the "disabled" attribute set to "false" do not pass its values to the server. Please take a look at the Disabled controls section of the W3C forms Standard article, which states that a disabled control "cannot receive user input nor will its value be submitted with the form" .
        At the same time, I should underscore that this behavior differs for different browsers. As Mike explained in Q276621 (ASPxTextBox ClientEnabled="false" loses value after postback): For the FireFox and WebKits browsers, the disabled="disabled" attribute is used to prevent an editor from being used. When you submit a form to the server, the value of a "disabled" input is not posted.
        We have created a simple project with a standard input and our ASPxTextBox to illustrate this specific in action. You can notice that both editors operate the same way and do not pass their text to the server. We have also created a screencast illustrating our explanation and a debugging page by using the Firebug tool.
        Your understanding is highly appreciated.
        Thanks,
        Jenny
        See Also:
        ASPxTextBox - When an editor is disabled on the client side, its Text is cleared after a postback

        Disclaimer: The information provided on DevExpress.com and affiliated web properties (including the DevExpress Support Center) is provided "as is" without warranty of any kind. Developer Express Inc disclaims all warranties, either express or implied, including the warranties of merchantability and fitness for a particular purpose. Please refer to the DevExpress.com Website Terms of Use for more information in this regard.

        Confidential Information: Developer Express Inc does not wish to receive, will not act to procure, nor will it solicit, confidential or proprietary materials and information from you through the DevExpress Support Center or its web properties. Any and all materials or information divulged during chats, email communications, online discussions, Support Center tickets, or made available to Developer Express Inc in any manner will be deemed NOT to be confidential by Developer Express Inc. Please refer to the DevExpress.com Website Terms of Use for more information in this regard.