Last active
December 31, 2015 20:08
-
-
Save bbmatt/8037776 to your computer and use it in GitHub Desktop.
Drupal & parsley.js - very quick method to enable parsley.js on drupal forms. Create a drupal module, in this case, I've called it parsley_form and enable it.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
; $Id: $ | |
name = Parsley.js form enabler | |
description = Adds necessary elements to form to enable parsley.js validation | |
core = 7.x |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* @file | |
* quick method to enable parsley.js on drupal forms | |
*/ | |
function mymodule_form_alter(&$form, &$form_state, &$form_id) { | |
$form['#attributes'] = array('parsley-validate' => array('parsley-validate')); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment