Adding fieldset and controls from codebehind / TextBoxes are not firing validation

  1. #1

    Adding fieldset and controls from codebehind / TextBoxes are not firing validation

    Hello!

    There is problem when I have placeholder in .aspx file and in codebehind I'm creating coolite FieldSet, few labels (and add them to created FieldSet) and after this I add this fieldset to placeholder. Fieldset and labels are showing but labels are outside fieldset.

    When I use coolite TextBox and try to validate it using default validation controls validation is not firing.

    Thanks
  2. #2

    RE: Adding fieldset and controls from codebehind / TextBoxes are not firing validation

    Hi GrZeCh,

    Can you provide us with a code sample demonstrating how you are adding the controls to the FieldSet?

    You also mentioned the validation. Do you mean the standard asp validation controls? or the built in validation functionality of the <cool:TextBox>?
    Geoffrey McGill
    Founder
  3. #3

    RE: Adding fieldset and controls from codebehind / TextBoxes are not firing validation

    <cool:TextBox ID="TextBox2" runat="server"></cool:TextBox>   
    <asp:RequiredFieldValidator ID="RequiredFieldValidator2" ValidationGroup="Webowe" runat="server" ErrorMessage="Pole wymagane" ControlToValidate="TextBox2"></asp:RequiredFieldValidator>                                
    
    <asp:TextBox ID="TextBox1" runat="server"></asp:TextBox>
    <asp:RequiredFieldValidator ID="RequiredFieldValidator1" ValidationGroup="Webowe" runat="server" ErrorMessage="Pole wymagane" ControlToValidate="TextBox1"></asp:RequiredFieldValidator>
    Try something like this (add button for submit after this). Validation is only fired for "normal" textbox (without postback).
  4. #4

    RE: Adding fieldset and controls from codebehind / TextBoxes are not firing validation

    ya, this is a bit of a problem. I also just noticed that the coolite Button control is not causing the Validation events to trigger. This is something we're going to try and get working for the next release.

    The Coolite TextBox control includes an internal validation mechanism that you might find helpful. There are several validation related properties which include:
    1. AllowBlank
    2. MaxLength
    3. MinLength
    4. Regex = A RegularExpression to be tested against the field value. Return true if valid, otherwise a string error message if validation fails.
    5. Validator = A custom JavaScript function which will fire. Return true if valid, otherwise a string error message if validation fails.

    Example

    <cool:TextBox 
        ID="TextBox1" 
        runat="server"
        AllowBlank="false"
        />
    Geoffrey McGill
    Founder

Similar Threads

  1. [CLOSED] Fieldset collapse codebehind
    By CarWise in forum 2.x Legacy Premium Help
    Replies: 3
    Last Post: Aug 03, 2012, 8:23 AM
  2. Adding Tab using codebehind
    By gevik in forum 1.x Help
    Replies: 9
    Last Post: Oct 02, 2011, 7:43 PM
  3. Replies: 3
    Last Post: Dec 21, 2010, 2:57 PM
  4. [CLOSED] Red circle is not visible in form validation with fieldset
    By 78fede78 in forum 1.x Legacy Premium Help
    Replies: 2
    Last Post: Oct 13, 2010, 2:14 PM
  5. FormPanel validation unexpected firing
    By RPIRES in forum 1.x Help
    Replies: 2
    Last Post: Jun 11, 2010, 9:36 PM

Posting Permissions