setting the RegEx property dynamicly!?!

  1. #1

    setting the RegEx property dynamicly!?!

    Hi,
    I am trying to validate a sign up form that has 2 fields one for the password and the other one is to retype the password.
    for sure i can set a listner or ajaxevent for each textfields to check if they are in match or not and disable or enable the form submition, thats a way.
    but i am thiking in making regex dynamic
    so i tried the following:
     <ext:Anchor Horizontal="100%">
                            <ext:TextField AllowBlank="false" BlankText="Password is required" ID="txtpassword1" runat="server" FieldLabel="Password">
                            <AjaxEvent>
                                <Change OnEvent="UpdateRetypeRegex"></Change>
                            </AjaxEvent>                            
                            </ext:TextField>
                        </ext:Anchor>
     <ext:Anchor Horizontal="100%">
                            <ext:TextField AllowBlank="false" BlankText="retype password is required" ID="txtpassword2" runat="server" FieldLabel="retype">                            
                            </ext:TextField>
                        </ext:Anchor>
    and at the server side i have
    protected void UpdateRetypeRegex(object sender, AjaxEventArgs e)
        {
            txtpassword2.regex = txtpassword1.text;
        }
    trying by that to set the regex value of the password2 textfield to be the exact value of the password1 textfield which make it validate its value based on this regex.

    but that didn't work. and i got an error that i captured through firebug, and it getting fired after i type any value in the password2 text field, which means the regex is getting a dynamic value but it doesn't accept the test function. maybe setting its value dyamicly, is defining it as string variable and its no longer recognized as regex. !!

    "this.regex.test is not a function
    validateValue()("password123")coolite.axd?30406 (line 1872)
    processValue()()coolite.axd?30406 (line 1830)
    cancel()()coolite.axd?30406 (line 477)
    [Break on this error] if(this.regex&amp;&amp;!this.regex.test(value)){.. .rkInvalid(this.regexText);return false;}"


    any Idea?
  2. #2

    RE: setting the RegEx property dynamicly!?!

    Did you solve your problem?

Similar Threads

  1. Replies: 1
    Last Post: Jun 08, 2012, 6:12 PM
  2. [CLOSED] [1.0] Setting Cls property on nodes with TreeGrid
    By tdracz in forum 1.x Legacy Premium Help
    Replies: 2
    Last Post: Jan 15, 2010, 1:23 PM
  3. Replies: 2
    Last Post: Jul 31, 2009, 9:16 AM
  4. [CLOSED]Setting text property of label
    By Jurke in forum 1.x Legacy Premium Help
    Replies: 4
    Last Post: Oct 15, 2008, 12:19 PM
  5. [FIXED] TextBox Regex property
    By clrnbeek in forum Bugs
    Replies: 1
    Last Post: Apr 21, 2008, 2:40 AM

Posting Permissions