Skip to content
This repository has been archived by the owner on Nov 8, 2018. It is now read-only.

davidmaneuver/formal

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Currently in development. Not ready for production.

##Introduction

Todo

##Getting Started

Todo

##Quick Example

Create your form in HTML like you're used to. Then just wrap it with Formal functions to enhance it.

<?php Formal::start(); ?>
  <form method="POST" name="example">
    <label>Name</label>
    <input type="text" name="name" required />

    <label>Email</label>
    <input type="email" name="email" required />

    <input type="submit" value="Submit" />
  </form>
<?php Formal::end(); ?>

Handle submits easily.

// Use the form name attribute as selector, 'example' in this case.
Formal::on('submit', 'example', function($data) {
  // Do something with the posted values in $data.
});

##Caveats

####1.

Do not close a tag right after an attribute without a value. Put a space between.

These are ok:

<form method="POST" name="frmContact">
<form method="POST" name="frmContact" novalidate >

This is not ok and will render incorrect:

<form method="POST" name="frmContact" novalidate>

####2.

About

Handle custom forms like a gentleman

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages