PHP Classes

File: example_w_jquery.php

Recommend this page to a friend!
Stumble It! Stumble It! Bookmark in Bookmark in
  Classes of Jonas Earendel  >  jForm Validator  >  example_w_jquery.php  >  Download  
File: example_w_jquery.php
Role: Example script
Content type: text/plain
Description: A small example with jQuery
Class: jForm Validator
Validate forms with rules defined in form template
Author: By
Last change: Added a link to the new css file.
Date: 2 years ago
Size: 1,709 bytes


Class file image Download


$html = '
    E-mail:<br />
    <input type="email" name="user[email]" required="required" value="" /><br />

    Url:<br />
    <input type="url" name="user[url]" required="user[email]!=\'\'" value="#" /><br />


$form = new jForm($html);

$_POST) and $form -> validate($_POST))
$form->triggerError('The form has passed validation','email');
$form->triggerError('The form has passed validation','url');

?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "">
<html xmlns="" lang="<?php echo LANGUAGE; ?>">
    <title>jForm php form validation demo!</title>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
    <script type="text/javascript" src=""></script>
    <script type="text/javascript" src="is.js"></script>
    <script type="text/javascript" src="jquery.validate.js"></script>
    <script type="text/javascript" src="jquery.validate.translations.<?php echo LANGUAGE; ?>.js"></script>
    <link rel="stylesheet" type="text/css" href="jform.css" media="screen, projection" />
    <style type="text/css">
            background-image: url(?jform-validator-image);
    <script type="text/javascript">
        $(function() {
<form id="jform" method="post" action="">
    <?php echo $form->html4(); ?>
<input type="submit" />