Smarty Forum Index Smarty
WARNING: All discussion is moving to https://reddit.com/r/smarty, please go there! This forum will be closing soon.

SmartyValidate Suggestion

 
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Smarty Forum Index -> Add-ons
View previous topic :: View next topic  
Author Message
conner_bw
Smarty Rookie


Joined: 21 Dec 2007
Posts: 17

PostPosted: Thu Feb 17, 2011 1:48 am    Post subject: SmartyValidate Suggestion Reply with quote

Hi,

I've been using SmartyValidate for a few years and I am very happy to see it upgraded to Smarty 3. Thanks!

That said, one thing really bugs me and I wish it would be improved.

Let me preface that $form is the 7th param of register_validator(). It also appears in several other functions as $form = SMARTY_VALIDATE_DEFAULT_FORM and always the last param.

The problem is, if I have two or more *different* forms named "default" opened in two or more browser tabs, only the last opened tab will work. All the other tabs are borked.

It took me a while to figure out what was going on, and more hours to try to hack in a solution to a problem I didn't really understand. Of course, after much face palming, the obvious solution is to give a unique name to each $form. But, lets be realistic, it's a nightmare to do this. 7th parameter?! Boooo!

Ideally, SmaryValidator could be improved so that `$this->form` or `new SmartyValidate('unique_name')`, or something that actually works be put in place that makes it easy to declare $form. Know what I mean?

Thank you for your consideration.

Regards,
Back to top
View user's profile Send private message
mohrt
Administrator


Joined: 16 Apr 2003
Posts: 7368
Location: Lincoln Nebraska, USA

PostPosted: Thu Feb 17, 2011 3:16 pm    Post subject: Reply with quote

You can define SMARTY_VALIDATE_DEFAULT_FORM before loading the validation class if you want to change the value of the default form. However, this won't help with multiple forms in the same script at the same time.
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Smarty Forum Index -> Add-ons All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group
Protected by Anti-Spam ACP