View Full Version : [CLOSED] V2.0 Validation Form Help

Mar 14, 2012, 1:40 PM
Hi, i need any help for validation the form and enabled button, this is the sample page:

1)If tipy any word in the first field, the button save now enable, if the field is empty the button is disable and

<ValidityChange Handler="App.ButtonSave.setDisabled(!valid);" /> work ok

2) Type any character in firts field and the button is enable,
If type "validate" in the second field and blur, the error appear ok, but the form not validate the state of the button, is't enable and not disable..

I can not disable the button, any solution is accepted



<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="WebForm1.aspx.cs" Inherits="ARWebRevolution.WebForm1" %>

<%@ Register Assembly="Ext.Net" Namespace="Ext.Net" TagPrefix="ext" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
<title>Ext.NET v2 Example</title>

<form id="Form1" runat="server">
<ext:ResourceManager ID="ResourceManager1" runat="server">

<ext:Viewport ID="Viewport1" runat="server" Layout="border">
<ext:FormPanel ID="FormPanelNazione" runat="server" ButtonAlign="Right" Height="185"
BodyPadding="10" Padding="3" Region="Center" Title="Nazioni..." Layout="AutoLayout">
<ext:TextField ID="txtForCod" runat="server" Width="180" AllowBlank="false"
BlankText="*Obbligatorio" MaxLength="8" MaxLengthText="*Lunghezza massima 8 caratteri."
FieldLabel="Codice" >
<ext:ToolTip ID="ToolTipForCod" runat="server" Title="Codice" Html="Codice del fornitore" />
<ext:TextField ID="txtRagSoc" runat="server" AnchorHorizontal="100%"
MaxLength="16" MaxLengthText="*Lunghezza massima 16 caratteri."
FieldLabel="Ragione sociale" >
<Blur CausesValidation="true" Handler="test()" />
<ext:ToolTip ID="ToolTip1" runat="server" Title="Codice" Html="Ragione sociale" />
<ext:Toolbar runat="server" ID="ToolBarFornitore">

<ext:Button ID="ButtonSave" runat="server" Text="Salva" Scale="Medium"
Icon="Disk" ToolTip="Salva le modifiche apportate"
ToolTipType="Title" Disabled="true">

<ValidityChange Handler="App.ButtonSave.setDisabled(!valid);" />
<script type="text/javascript" >

//Controllo Codice Fiscale

function test () {
var cf = App.txtRagSoc.getValue();
if (cf == 'validate') {
return false;

return true;


Mar 14, 2012, 2:11 PM

The markInvalid method doesn't cause a field to be validated.

Please use Validator.


<ext:TextField ...>
<Validator Fn="myValidator" />

See also

Mar 14, 2012, 2:55 PM
HI, Daniil very very thanks..it's work ok