Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Added Placeholders.js to enable placeholder functionality in IE9 and …

…below
  • Loading branch information...
commit 73714067a5f3d363f37bbe96d7f09b577902d720 1 parent 0245611
@mschilder mschilder authored
View
3  .gitmodules
@@ -1,3 +1,6 @@
[submodule "thirdparty/jquery-validate"]
path = thirdparty/jquery-validate
url = git://github.com/jzaefferer/jquery-validation.git
+[submodule "thirdparty/Placeholders.js"]
+ path = thirdparty/Placeholders.js
+ url = git://github.com/jamesallardice/Placeholders.js.git
View
3  code/model/UserDefinedForm.php
@@ -313,6 +313,7 @@ public function init() {
Requirements::javascript(FRAMEWORK_DIR .'/thirdparty/jquery/jquery.js');
Requirements::javascript('userforms/thirdparty/jquery-validate/jquery.validate.js');
Requirements::javascript('userforms/javascript/UserForm_frontend.js');
+ if($this->HideFieldLabels) Requirements::javascript('userforms/thirdparty/Placeholders.js/Placeholders.min.js');
}
/**
@@ -487,7 +488,7 @@ public function getRequiredFields() {
if($this->EnableLiveValidation) $onfocusout = ", onfocusout : function(element) { this.element(element); }";
// Hide field labels (use HTML5 placeholder instead)
- if($this->HideFieldLabels) $hidelabels = '$("#Form_Form label.left").each(function(){$("#"+$(this).attr("for")).attr("placeholder",$(this).text());$(this).remove();});';
+ if($this->HideFieldLabels) $hidelabels = '$("#Form_Form label.left").each(function(){$("#"+$(this).attr("for")).attr("placeholder",$(this).text());$(this).remove();});Placeholders.init();';
// Set the Form Name
$rules = $this->array2json($rules);
1  thirdparty/Placeholders.js
@@ -0,0 +1 @@
+Subproject commit 50833cedc22e2de8061ecdc2fb8f93347ccf30ed
Please sign in to comment.
Something went wrong with that request. Please try again.