I have this form:
<form>
<dxe:ASPxDateEdit runat="server" ID="BirthDate" Date="5/6/1985" ClientEnabled="false"/>
<p />Got: <%= Request.Form("BirthDate")%><p />
<input type="submit" value="Submit" />
</form>
If the user submits this form in IE 8, the page renders "Got: 5/6/1985" but in Firefox 3.6 it just renders "Got:".
Is there any way to change the behavior in IE to be the same as Firefox. I do not want the form value to submit if the control is disabled.
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.
Hello Tzadik,
Thank you for the report. It seems that when an input is disabled, the browser still posts postback data to the server side. I have examined your approach, and suggest that you create a label instead of code blocks and fill it with appropriate values. For example, you can handle the label's Load event in the following manner:
protected void lbl_Load (Object sender, EventArgs e) { ASPxLabel lbl = sender as ASPxLabel; if (BirthDate.ClientEnabled) lbl.Text = String.Format("Got: {0}", BirthDate.Text); else lbl.Text = "Got:"; }
Thanks,
Vest
Thanks for your speedy reply. But I have 2 issues with it:
Hello Tzadik,
To make our editors be consistent in different browsers, we do not disable an input element in the IE to allow users to apply disabled styles. When an editor has a disabled input tag, the browser will not allow applying custom styles to it.
For the IE in particular, we make editors readonly.
I see the inconsistent behavior between FireFox and IE when your code is used. However, I am not sure that it can be changed. If you want to disable our controls to prevent their values from being submitted to the server, you can disable an input element manually:
BirthDate.GetInputElement().disabled = "true";
However, you should always remember that this approach might break your styles. in some browsers.
Thanks,
Vest
thanks, vest