Smarty Forum Index Smarty
The discussions here are for Smarty, a template engine for the PHP programming language.

Formcat 1.01 (client-side validation plugins) Released.

 
Post new topic   Reply to topic    Smarty Forum Index -> Add-ons
View previous topic :: View next topic  
Author Message
joey
Smarty Regular


Joined: 29 Oct 2003
Posts: 57

PostPosted: Tue Jan 04, 2005 9:45 am    Post subject: Formcat 1.01 (client-side validation plugins) Released. Reply with quote

Formcat 1.01 released

[2005-01-03] Formcat 1.01 is a class for form validation in client-side.Its design goal is to generate the javascript for client-side validation as easy and flexible as possible.It runs on Smarty as a powerful plug-in.

[visit the Formcat site] [Download Formcat]

[BackGroud]
Form validation is one of the most frequently performed tasks when it comes to web application programming.In order to decrease the run load of server,we usually validate the data in client-side by Javascript or other script,but it's a tedious and time-consuming task.

SmartyValidate is powerful class to provide form validation in server-side.I didn't find a good solution for client-side validation.[url][/url]
_________________
Joey
Senior Developer & Designer
-------------------------------------------
http://www.propagator.net
[SourceForge Project] Formcat with Smarty!
http://www.propagator.net/formcat/
Back to top
View user's profile Send private message Send e-mail Visit poster's website MSN Messenger
ganeshk74
Smarty n00b


Joined: 29 Dec 2004
Posts: 2

PostPosted: Wed Jan 05, 2005 3:40 am    Post subject: Formcat example code not working. Reply with quote

The Formcat appears to be a good tool. But when I tested the example code it did not show any validation code.

What I saw in the source:

<form name="formReg" action="register.php" method="POST" onSubmit='return pigcatFCValidate_formReg(this);'>

I think the validation function is not generated.
Back to top
View user's profile Send private message Yahoo Messenger
joey
Smarty Regular


Joined: 29 Oct 2003
Posts: 57

PostPosted: Wed Jan 05, 2005 4:58 am    Post subject: the bug has fixed Reply with quote

Thank you friend. help me to find the bug.
pls see the changelog

[2005-01-05]
* fix a bug from formcat.class.php and block.catform.php,put the genenrated scripts
above the <form> instead of <head>.
_________________
Joey
Senior Developer & Designer
-------------------------------------------
http://www.propagator.net
[SourceForge Project] Formcat with Smarty!
http://www.propagator.net/formcat/
Back to top
View user's profile Send private message Send e-mail Visit poster's website MSN Messenger
fire
Smarty n00b


Joined: 23 Jan 2005
Posts: 2

PostPosted: Sun Jan 23, 2005 5:47 pm    Post subject: I too cant get the formcat to work Reply with quote

Thanks for your script... but

I cant seam to get it wroking... do I have to manually edit the files you mentioned to fix the bug, or did you fix it already?

what do you mean "move the generated script above the form tag?"

Please help me get the example script working Smile

thanks!!!!
Back to top
View user's profile Send private message
fire
Smarty n00b


Joined: 23 Jan 2005
Posts: 2

PostPosted: Sun Jan 23, 2005 5:53 pm    Post subject: ahhaa! Reply with quote

ok!

I now downloaded the lite version and it works! I think you forgot to update the pro version!

ok! cool!

cheers
Back to top
View user's profile Send private message
joey
Smarty Regular


Joined: 29 Oct 2003
Posts: 57

PostPosted: Wed Jan 26, 2005 2:40 pm    Post subject: The pro version has been updated Reply with quote

The pro version has been updated . but you should make sure the the validators directory has copied. and set the $validatorPath in the formcat.class.php
_________________
Joey
Senior Developer & Designer
-------------------------------------------
http://www.propagator.net
[SourceForge Project] Formcat with Smarty!
http://www.propagator.net/formcat/
Back to top
View user's profile Send private message Send e-mail Visit poster's website MSN Messenger
joey
Smarty Regular


Joined: 29 Oct 2003
Posts: 57

PostPosted: Thu Feb 24, 2005 6:22 am    Post subject: Formcat 1.03 Released Reply with quote

Formcat 1.03 Released

download[/url]
_________________
Joey
Senior Developer & Designer
-------------------------------------------
http://www.propagator.net
[SourceForge Project] Formcat with Smarty!
http://www.propagator.net/formcat/
Back to top
View user's profile Send private message Send e-mail Visit poster's website MSN Messenger
jotango
Smarty Rookie


Joined: 20 Apr 2005
Posts: 13

PostPosted: Thu May 18, 2006 9:04 am    Post subject: justto.com refuses connections Reply with quote

I would like to try this plugin, but can't download it, host seems to be down
Back to top
View user's profile Send private message
alexanderlim
Smarty n00b


Joined: 27 Dec 2006
Posts: 2

PostPosted: Wed Dec 27, 2006 5:28 pm    Post subject: Reply with quote

I received this error message on both lite and pro version when trying to run the example included:

Warning: Smarty error: unable to read resource: "formcat.html" in C:\Server\Apache2\htdocs\test\formcat1.04-pro\smarty\libs\Smarty.class.php on line 1095

Is there something I have done wrong?

Suggestion :
why dont you put everything that is needed (smarty etc etc...) in a bundle .zip file as another option for people to download. That way newbie like me who is not familiar or not heard of smarty can at least get the example to work. Instead of mentioning in the documentation that the user who is trying for the first time, asking them to download this and that, copy this from there to here etc etc... It really put people off to continue using it or even supporting your work if they are hit with error when even trying out a (which appear to be) simple example. Well, thats my 2 cents worth of opinion, the decision is up to you.

Thanks for your help in advance.

Alex
Back to top
View user's profile Send private message
gcphost
Smarty Rookie


Joined: 21 Jan 2006
Posts: 8

PostPosted: Mon Feb 26, 2007 3:28 am    Post subject: Reply with quote

Formcat 1.04 is not XHTML Strict.


This was the only formcat thread here so I hope someone will see this...



Class file needs to read:

Code:

$replace = "<script type=\"text/javascript\">".


Code:

"/* <![CDATA[ */\n".
$this->jsStr.
"/* ]]> */\n</script>\n";    


function flashing:
Code:

eval('document.getElementById(\"'+name+'\").style.background=('+c+')?\"'+colorFlashing2+'\":\"'+colorFlashing+'\"');


line 155 to call flashing tho i dont think it matters any more since it switched to get element:

Code:

if($this->frmExtraFunc['flashFocus']) $str.="flashing(fc.id, '$field',0,10,0);\n";                          //Flash focus function




block.catform.php

change onSubmit to onsubmit.


I have not tested anything more then notEmpty (or w/e) and isValid, they both are working.


The name="" element on your form will need to be removed, name is no longer assigned to form elements in xhtml.


formcat is great! hopefully my donation helps.
Back to top
View user's profile Send private message
gcphost
Smarty Rookie


Joined: 21 Jan 2006
Posts: 8

PostPosted: Fri Apr 27, 2007 9:44 pm    Post subject: Issues on IIS Reply with quote

FormCat does not work on IIS systems out of the box.


Update your class:
Code:

   function addExtraFunc($funcName){

         if($funcName!=''&& $funcName!='form' && $funcName!='FORM' && $funcName!='Form'){
            if(is_array($this->extraFuncList)){
            if(!in_array($funcName,$this->extraFuncList)){
               $this->extraFuncList = array_merge($this->extraFuncList,array($funcName));
            }
         } else $this->extraFuncList =array($funcName);
         }
   }
Back to top
View user's profile Send private message
vmegag
Smarty n00b


Joined: 07 Mar 2007
Posts: 3

PostPosted: Thu Sep 13, 2007 7:16 am    Post subject: bug into extra_function_submitOnce() Reply with quote

Joey,

I'm using formcat since months now without much problems. But since days I got an error msg from javascript saying
Quote:
type is nul or not an object
.
After hours of investigations :
Inside the function submitOnce(theform), there is a loop
Code:
 for (i = 0; i < theform.length; i++) {
theform.length will return the length of the form name which is just posted. In my case
Code:
<form name="frm_gproducers_edt" id="frm_gproducers_edt" action="gproducers.php" method="post">
Then the loop will simply run 18 times just because theform.length returns 18, which is ridiculous...Smile I only have 12 elements in my form. I din't get this error before just because usually the number of elements in my form is higher than the form name itself !! AMAZING !!

Then the proposed solution would be: formcat.class.php
Code:
   function extra_function_submitOnce(){
       //generate javascript
       $str="\n //Submit Once Function (author: Joey)\n
       function submitOnce(theform) {      
      
       if (document.all || document.getElementById) {
          
         // ----- Replaced by Vincent Megag on 13/09/2007 ------
         frm = eval(theform);
         var inputTags = frm.getElementsByTagName('input');
         for (i = 0; i < inputTags.length; i++) {
            var tempobj = inputTags[i];
         // -------------------------------------------------
         
            if (tempobj.type.toLowerCase() == 'submit' || tempobj.type.toLowerCase() == 'reset')
               tempobj.disabled = true;
         }
         setTimeout('alert(\"$this->defaultSubmitOnceMsg\")', 1500);
         return true;
         }
         else {
         alert('$this->defaultSubmitOnceMsg');
         return false;
           }
      }
      ";
      return $str;
   }



Vincent

Hope this solution helps people. Wink

Thanks to Marc-André...
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    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