2 Replies Latest reply on May 9, 2013 11:40 PM by Sham HC

    Regex Property in PathField

    KirthivasanGanesan

      Hi Lads

       

      I am creating a Multifield which contains a PathField. I am setting up the properties for this PathField. When I am setting up the regex property for this PathField I am getting the following error on the console. Here is my Code. Please help me to identify where I am doing wrong.

       

      // Picture URL

                              this.add(new CQ.Ext.form.Label( {

                                  cls : "customwidget-label",

                                  text : ""

                              }));

                              this.bannerImageURL = new CQ.form.PathField( {

                                  cls : "customwidget-1",

                                  fieldLabel : "Picture Link: ",

                                  editable:false,

                                  allowBlank : false,

                                  anchor: '75%',

                                  rootPath :"/etc/designs/aib/business/images",

                                  regex :"/(\.|\/)(gif|jpeg|jpg|png)$/i",

                                  maxLength : 100,

                                  listeners : {

                                      change : {

                                          scope : this,

                                          fn : this.updateHidden

       

                                      },

                                      dialogclose : {

                                          scope : this,

                                          fn : this.updateHidden

       

                                      }

                                  }

                              });

                              this.add(this.bannerImageURL);

       

       

      Error I am getting on console

       

      TypeError: this.regex.test is not a function

       

      if (this.regex && !this.regex.test(value)) {

       

      Thanks in Advance

       

      Cheers

      Kirthi