[TYPO3-project-formidable] Testing Formidable "How to use validators".
Ian Solo
ian at webian.it
Fri Apr 25 15:12:28 CEST 2008
Hello Luc,
thanks for the answer
Luc Muller wrote:
> Hello Ian.
>
> Glad to see formidable is getting new "addicts" :p
>
Yes, I have the feeling that I will become addicted to this framework :)
I'm sorry that I told too less...
I forgot to mention that I'm using:
TYPO3 4.1.6
PHP 5.2.0
MySQL 4.1.7
ameos_formidable 1.0.0
Following this tutorial:
http://formidable.typo3.ug/tutorials/start-up-a-project-with-formidable.html
I made a simple FE plugin extension with the Kickstarter, and called it
"ian_formidabletest".
Here follow the class.tx_ianformidabletest_pi1.php code without the
comments:
*******************************************
START OF class.tx_ianformidabletest_pi1.php
*******************************************
<?php
require_once(PATH_tslib.'class.tslib_pibase.php');
require_once(PATH_formidableapi);
class tx_ianformidabletest_pi1 extends tslib_pibase {
var $prefixId = 'tx_ianformidabletest_pi1';
var $scriptRelPath = 'pi1/class.tx_ianformidabletest_pi1.php';
var $extKey = 'ian_formidabletest';
var $pi_checkCHash = true;
function main($content,$conf) {
$this->oForm = t3lib_div::makeInstance("tx_ameosformidable");
$this->oForm->init(
$this, // reference to the current plugin object
"EXT:ian_formidabletest/pi1/xml/myapp.xml" // soft-path to xml file
);
return $this->oForm->render();
}
}
if (defined('TYPO3_MODE') &&
$TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['ext/ian_formidabletest/pi1/class.tx_ianformidabletest_pi1.php'])
{
include_once($TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['ext/ian_formidabletest/pi1/class.tx_ianformidabletest_pi1.php']);
}
?>
*******************************************
END OF class.tx_ianformidabletest_pi1.php
*******************************************
Then I started to play with the file myapp.xml...
> Which validator are you trying to implement ?
> Can you show us the Xml file your're using ?
I first tried this:
******************
START OF myapp.xml
******************
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<formidable version="1.0.0"
xmlns:datahandler="http://www.ameos.com/formidable/1.0.0/datahandler"
xmlns:datasource="http://www.ameos.com/formidable/1.0.0/datasource"
xmlns:renderer="http://www.ameos.com/formidable/1.0.0/renderer"
xmlns:renderlet="http://www.ameos.com/formidable/1.0.0/renderlet"
xmlns:validator="http://www.ameos.com/formidable/1.0.0/validator"
xmlns:actionlet="http://www.ameos.com/formidable/1.0.0/actionlet">
<meta>
<name>Standard XML file</name>
<form formid="myform"/>
<debug>false</debug>
<displaylabels>true</displaylabels>
</meta>
<control>
<datahandler:VOID/>
<renderer:STANDARD/>
</control>
<elements>
<renderlet:TEXT name="required" label="My text field required">
<validators>
<validator:STANDARD>
<required message="text field is required" />
</validator:STANDARD>
</validators>
</renderlet:TEXT>
<renderlet:SUBMIT name="submit" value="submit" label="submit" />
</elements>
</formidable>
******************
END OF myapp.xml
******************
The page shows the form with:
the label "My text field require"
the input box
the submit button
I click the submit button without write on the input box, the page
refresh but I don't get any error "text field is required".
I also checked the source of the page.
Then I tried with the xml in your link [1]. Same result.
Then I tried with the xml in this page:
http://formidable.typo3.ug/features/accessibility-with-unobtrusive-js.html
and this works.
That's all. If you need more informations, just ask.
Thanks again!ian
>
> It's a bit hard to tell why it's not working, normally, if you're using
> the XML[1] that is added to the tutorial it "should" work.
>
> Can you tell us a bit more ?
>
> thanks in advance,
>
> Luc Muller
>
> [1] http://formidable.typo3.ug/pastebin/snippet/28.html
>
> Ian Solo a écrit :
>> Hello,
>> I just started to study Formidable and I have a little problem:
>>
>> I'm following this tutorial [1], I can display the form in the FE but,
>> when I submit the form, the page doesn't display any error and I can't
>> figure out the reason.
>>
>> Any ideas?
>> Thank you in advance for your time and for this great framework!
>> ian.
>>
>> [1]
>> http://formidable.typo3.ug/typo3-form-news/news/0018-how-to-use-validators/start/1209053490/back/2.html
>>
>
>
> --
>
> *Luc Muller*
> /Web Developper/
> /Formidable - Rapid Application Developpement Framework for Typo3
> <http://formidable.typo3.ug>/
> /Typo3 Ameos <http://www.ameos.com>/
>
More information about the TYPO3-project-formidable
mailing list