Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/vodolaz095/triviaform
PHP library for generating html4 forms and validation of their submit
https://github.com/vodolaz095/triviaform
Last synced: about 4 hours ago
JSON representation
PHP library for generating html4 forms and validation of their submit
- Host: GitHub
- URL: https://github.com/vodolaz095/triviaform
- Owner: vodolaz095
- Created: 2012-06-09T19:35:49.000Z (over 12 years ago)
- Default Branch: master
- Last Pushed: 2012-08-16T13:07:33.000Z (over 12 years ago)
- Last Synced: 2024-04-09T23:07:25.324Z (7 months ago)
- Language: PHP
- Size: 109 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
TRIVIAform
==========PHP library for generating html4 forms and validation of their submit
Example code
```phpForm Test
addText('Text','Text');
$form1->addTextArea('long_text','Long text');
$form1->addCheckBox('checkbox1','Checkbox',1);
$form1->addCheckBox('checkbox2','Selected checkbox',1,true);
$form1->addLabel('Label','Label','Test');
$form1->addPassword('password','Password');
if($form1->submit())
{
echo 'Form 1 submited
';
echo '';';
print_r($form1->getClean());
echo '
}
echo 'Form1
';
echo $form1->render('Save','Cancel');$form2=new FORM('form2_csrt_key');
$form2->addText('digit1','Single digit from 0 to 9','','~^\d$~');
$form2->addText('digit2','Single digit from 0 to 9. But NOT 5','','~^\d$~');
if($form2->submit())
{
if($form2->getClean('digit2')==5)
$form2->setError('digit2','NOT 5 PLEASE!');
echo 'Form 2 submited
';
echo '';';
print_r($form2->getClean());
echo '
}
echo 'Form2
';
echo $form2->render('Save','Cancel');
?>```