[CLOSED] [1.0] form validation - hidden fields

  1. #1

    [CLOSED] [1.0] form validation - hidden fields

    It appears that form.IsValid() validates hidden fields on a page. This isn't a desirable function in most cases. can this be disabled?
    Last edited by Daniil; Oct 20, 2010 at 2:04 PM. Reason: [CLOSED]
  2. #2
    Hi,

    As far as I can know there is no option to disable validation of hidden fields.

    You could override the Field's isValid() function adding a condition like this:
    if (!this.isVisible()) { return true; }
    But what about disabling fields to avoid its validation?
    The isValid() function returns true for disabled fields.
  3. #3
    Hi,

    What problem do you have with validation? As I know hidden field has no any validation logic therefore it should not affect on final result (valid or invalid)
  4. #4
    Hi Vladimir,

    I think @betamax meant a problem like the following one:

    Example
    <%@ Page Language="C#" %>
    
    <%@ 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 runat="server">
        <title>Ext.Net Example</title>
    </head>
    <body>
        <form runat="server">
        <ext:ResourceManager runat="server" />
        <ext:FormPanel ID="FormPanel1" runat="server">
            <Items>
                <ext:TextField runat="server" />
                <ext:TextField runat="server" AllowBlank="false" Hidden="true" />
            </Items>
        </ext:FormPanel>
        <ext:Button runat="server" Text="FormPanel1.isValid()">
            <Listeners>
                <Click Handler="alert(FormPanel1.isValid());"/>
            </Listeners>
        </ext:Button>
        </form>
    </body>
    </html>
  5. #5

    [CLOSED] thanks

    Thanks Danil for the clarification. Yes, we were referring to fields set to "hidden". In this instance an ext textfield.
    The override seems to be an adequate solution.
  6. #6
    Also please note that you can override the isValid() method of particular instance only using CustomConfig.

Similar Threads

  1. [CLOSED] [1.0] Hidden Fields Not Being Submitted
    By rcaunt in forum 1.x Legacy Premium Help
    Replies: 4
    Last Post: Aug 25, 2011, 8:23 PM
  2. Login form - validation form
    By LordMX in forum 1.x Help
    Replies: 0
    Last Post: Aug 14, 2011, 11:44 AM
  3. [CLOSED] Hidden Fields, SqlDataSource, ComboBox Update Grid Problem
    By rthiney in forum 1.x Legacy Premium Help
    Replies: 1
    Last Post: May 24, 2010, 4:06 PM
  4. [CLOSED] Validation within Composite fields
    By jeremyl in forum 1.x Legacy Premium Help
    Replies: 3
    Last Post: May 12, 2010, 5:54 AM
  5. Replies: 3
    Last Post: Apr 19, 2010, 5:00 AM

Posting Permissions