Example form is linked to a database table, but won't be saved in this example.

When you submit the form, the value is presented with debug_dump(), so strings are quoted and array values listed.

:
: - Stop the submitted form from bring processed
: - Don't process the form, redirect to another page (e.g. login after session timeout), and remember the values for when they return.

or back to examples


<?php
	$field = new form_field_file($form, 'File');
	$field->max_size_set('The file cannot be bigger than XXX.', 1024*1024*1);
	$field->allowed_file_types_mime_set('The file has an unrecognised file type (XXX).', array('text/plain', 'application/pdf'));
	$field->allowed_file_types_ext_set('The file has an unrecognised file type (XXX).', array('txt', 'pdf'));
	$field->required_error_set('The file is required.');
?>