Feed

swapeForm

admin on Jul 30th 2007

Here is an easy php 5 class to make dynamic form table.

I made this class to make dynamic forms. With this class you don't have to write html code for form and a table.

Here is how to use this class:

 
< ?php
include('swapeForm.php');
 
$form = new swapeForm();
$form->add('Name');  // adding input
$form->setAttrib('id' , 'formName');  // adding atributes to input
$form->setAttrib('type' , 'text');
$form->setAttrib('name' , 'formName');
$form->setAttrib('size' , '40');
 
$form->add('Password');
$form->setAttrib('id' , 'formPass');
$form->setAttrib('type' , 'password');
$form->setAttrib('name' , 'formPass');
 
$form->addTextArea('Message','some value'); // adding textArea
$form->setAttrib('cols' , '20');  // adding textarea attributes
$form->setAttrib('rows' , '5');
$form->setAttrib('id' , 'formMessage');
 
$form->formInfo('POST','?'); // adding form method and action values
$form->addSubmit('Send values');
$form->show();
?>
 

Demo
swapeForm_v02.zip

Filed in Scripts | No responses yet

Trackback URI |

Leave a Reply

You must be logged in to post a comment.