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

This commit is contained in:
Menno Schilder 2012-12-14 16:37:37 +01:00 committed by Will Rossiter
parent 70f45d82f4
commit 3015997bdf
3 changed files with 6 additions and 1 deletions

3
.gitmodules vendored
View File

@ -1,3 +1,6 @@
[submodule "thirdparty/jquery-validate"] [submodule "thirdparty/jquery-validate"]
path = thirdparty/jquery-validate path = thirdparty/jquery-validate
url = git://github.com/jzaefferer/jquery-validation.git 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 File

@ -330,6 +330,7 @@ class UserDefinedForm_Controller extends Page_Controller {
Requirements::javascript(FRAMEWORK_DIR .'/thirdparty/jquery/jquery.js'); Requirements::javascript(FRAMEWORK_DIR .'/thirdparty/jquery/jquery.js');
Requirements::javascript('userforms/thirdparty/jquery-validate/jquery.validate.js'); Requirements::javascript('userforms/thirdparty/jquery-validate/jquery.validate.js');
Requirements::javascript('userforms/javascript/UserForm_frontend.js'); Requirements::javascript('userforms/javascript/UserForm_frontend.js');
if($this->HideFieldLabels) Requirements::javascript('userforms/thirdparty/Placeholders.js/Placeholders.min.js');
} }
/** /**
@ -506,7 +507,7 @@ class UserDefinedForm_Controller extends Page_Controller {
if($this->EnableLiveValidation) $onfocusout = ", onfocusout : function(element) { this.element(element); }"; if($this->EnableLiveValidation) $onfocusout = ", onfocusout : function(element) { this.element(element); }";
// Hide field labels (use HTML5 placeholder instead) // 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 // Set the Form Name
$rules = $this->array2json($rules); $rules = $this->array2json($rules);

1
thirdparty/Placeholders.js vendored Submodule

@ -0,0 +1 @@
Subproject commit 50833cedc22e2de8061ecdc2fb8f93347ccf30ed