You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Mohammad Shamsi <m....@gmail.com> on 2008/09/05 19:22:03 UTC
Fwd: [T5] - implement new client side validator
any idea ?
Hi friends,
i am going to add new validator in my T5 project.
the server side validatioin is ok and i have no problem with it.
but in client side, i changed the Tapestry.js to add my validator funciton
in it.
is there any better way to avoid change Tapestry original javascripts ?
--
sincerely yours
M. H. Shamsi
--
sincerely yours
M. H. Shamsi
Re: [T5] - implement new client side validator
Posted by Mohammad Shamsi <m....@gmail.com>.
Hi,
i was sent asked this question long times ago, about adding client side
validator to T5.
but i couldn't do that yet.
if i add this script before my form component, i got an error that :
Tapestry undifined.
because T5 includes js link in form component.
if i add this script after my form. i got another error because Tapestry try
to access to a new function validator that is not available yet.
any idea ???
On Sat, Sep 6, 2008 at 2:03 AM, Josh Canfield <jo...@thedailytube.com> wrote:
> Javascript allows you to dynamically change an object. Instead of editing
> tapestry.js create your own js that gets added after tapestry.js and modify
> the validators then.
>
> Something like:
>
> Tapestry.Validator.yourvalidator = function(field, message, param) {
> Tapestry.addValidator(field, true, function(value, event) { /*
> validation here */
> });
> }
>
> Josh
>
> On Fri, Sep 5, 2008 at 10:22 AM, Mohammad Shamsi <m.h.shams@gmail.com
> >wrote:
>
> > any idea ?
> >
> > Hi friends,
> >
> > i am going to add new validator in my T5 project.
> > the server side validatioin is ok and i have no problem with it.
> > but in client side, i changed the Tapestry.js to add my validator
> funciton
> > in it.
> >
> > is there any better way to avoid change Tapestry original javascripts ?
> >
> > --
> > sincerely yours
> > M. H. Shamsi
> >
> >
> >
> > --
> > sincerely yours
> > M. H. Shamsi
> >
>
>
>
> --
> --
> TheDailyTube.com. Sign up and get the best new videos on the internet
> delivered fresh to your inbox.
>
--
sincerely yours
M. H. Shamsi
Re: [T5] - implement new client side validator
Posted by Josh Canfield <jo...@thedailytube.com>.
Javascript allows you to dynamically change an object. Instead of editing
tapestry.js create your own js that gets added after tapestry.js and modify
the validators then.
Something like:
Tapestry.Validator.yourvalidator = function(field, message, param) {
Tapestry.addValidator(field, true, function(value, event) { /*
validation here */
});
}
Josh
On Fri, Sep 5, 2008 at 10:22 AM, Mohammad Shamsi <m....@gmail.com>wrote:
> any idea ?
>
> Hi friends,
>
> i am going to add new validator in my T5 project.
> the server side validatioin is ok and i have no problem with it.
> but in client side, i changed the Tapestry.js to add my validator funciton
> in it.
>
> is there any better way to avoid change Tapestry original javascripts ?
>
> --
> sincerely yours
> M. H. Shamsi
>
>
>
> --
> sincerely yours
> M. H. Shamsi
>
--
--
TheDailyTube.com. Sign up and get the best new videos on the internet
delivered fresh to your inbox.