PDA

View Full Version : Don't want TextField AllowBlank to display validation error on initial page load



jchau
Jul 02, 2008, 3:59 PM
<ext:TextField ID="txtUsername" runat="server" MaxLength="64" Width="200px" AllowBlank="false"
BlankText="Username is required." MaxLengthText="Username can not exceed 64 characters.">
</ext:TextField>


When the page loads, the textbox is already in an invalid state because there are no text in it. However, from ExtJS's demo page, their textbox only shows the validation error after it looses focus. Is there a property I can set to mimic that behavior? I only want the textbox to be validated when it looses focus or if a login button on the form is clicked.

Timothy
Jul 02, 2008, 5:35 PM
Agreed.

I've encountered a similar issue in 0.5.3. Would this be because we do not have a FormPanel?

Cheers,
Timothy

geoffrey.mcgill
Jul 05, 2008, 3:42 AM
As noted in the Bugs Forum (http://forums.ext.net/showthread.php?threadid=837-5-1.aspx), this bug has been fixed.

Code will be available with the v0.6 release or now via SVN.

Hope this helps.

Roshan
Jun 27, 2012, 2:19 PM
To resolve this issue you need to set in your code behind as follows:

FormPanelName.Reset();