Programming HTML forms in PHP with emails, urls, checkboxes, selects, textareas, and validation is a time consuming process. This system makes it easy - with examples! I use this tiny library because:
Grab the files here: forms-3.zip
Output from submitting forms will appear here:
Array ( )
form_start();
form_text('name');
form_submit();
form_end();
form_start('#examples','post','test_form','edit_form confirm_unload'); // edit form gives it some style
form_text('name','Your Name','','I set .required .input_title to be bold.
I set .invalid .input_title to be red.','required');
form_password('password','Your Pass','','Hint: If I was going to sleigh citizen kane...');
form_email('email','Your Email','','We won\'t save any of these. It\'s just a demo.','required');
form_hidden('hidden_value','Yo momma');
form_static('Note','I hid a value in the code just above this line.','It\'s true, he did.');
form_url('url','Your URL','invalid URL','don\'t forget the http:// part!');
form_textarea('textarea','Your Comment');
form_checkbox('checkbox','Check this:','','I rarely read the terms of service.','required');
$arr=array(''=>'','1'=>'Puppies','2'=>'Death Metal','3'=>'Videos of people operating on themselves','4'=>'Babies');
form_date('date','When?',
array('min'=>date('Y-m-d'),
'max'=>date('Y-m-d', strtotime('+1 month'))),
date('Y-m-d', strtotime('+1 week')),
'test','required');
form_select('choice','Favorite:',$arr,0,'The rest will all be shipped to North Korea.','required');
form_cancel('cancel','No, No, No!','Do not click me');
form_submit('submit','Oh, YEAH!','Click me, I love it!','Have you double checked everything?');
form_end();
Please read the forms.php, form_block.php, forms.js, and forms.css files for more details.
If you have anything to contribute to the library, please feel free to send it and I will add it in.
I don't expect anything for this but feedback, donations, and offers of work are always welcome. ;)
Thanks!
