PHP Classes

File: example.form.php

Recommend this page to a friend!
  Classes of Jonas Earendel   Simple Form Validator   example.form.php   Download  
File: example.form.php
Role: Auxiliary script
Content type: text/plain
Description: Auxiliary script
Class: Simple Form Validator
Validate forms with rules defined in the HTML
Author: By
Last change:
Date: 7 years ago
Size: 1,456 bytes
 

Contents

Class file image Download
<label>type="radio"</label>
<input type="radio" name="a_radio_button" value="something" /> Something<br />
<input type="radio" name="a_radio_button" value="något annat" /> Något annat

<label>type="checkbox", required</label>
Checkbox <input required type="checkbox" name="foo[bar]" value="some_value" />

<label>type="email", required</label>
<input type="email" required name="test[email][weird_name_just_to_prove_it_works]" />

<label>type="text", repeat e-mail from above</label>
<input type="text" name="test[email][repeated]" data-match="test[email][weird_name_just_to_prove_it_works]">

<label>type="text" data-type="email" (data-type can be used to validate hidden inputs)</label>
<input type="text" data-type="email" name="test[type_email]" />

<label>type="password"</label>
<input type="password" name="test[password]" />

<label>type="password", repeated</label>
<input type="password" name="test[repeat_password]" data-match="test[password]" />

<label>select, required</label>
<select class="" name="a_list" required>
    <option value="">--</option>
    <option value="o1">Option 1</option>
    <option value="o2">Option 2</option>
    <option value="ett konstigt värde">ett konstigt värde</option>
    <option value="o4">Option 4</option>
    <option value="o5">Option 5</option>
</select>
<label>textarea, required</label>
<textarea name="area" rows="4" cols="30" required></textarea><br>
<input type="submit" value="Submit button" />