mirror of
https://github.com/silverstripe/silverstripe-userforms.git
synced 2024-10-22 15:05:42 +00:00
Added Placeholders.js to enable placeholder functionality in IE9 and below
This commit is contained in:
parent
70f45d82f4
commit
3015997bdf
3
.gitmodules
vendored
3
.gitmodules
vendored
@ -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
|
||||
|
@ -330,6 +330,7 @@ class UserDefinedForm_Controller extends Page_Controller {
|
||||
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');
|
||||
}
|
||||
|
||||
/**
|
||||
@ -506,7 +507,7 @@ class UserDefinedForm_Controller extends Page_Controller {
|
||||
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
vendored
Submodule
1
thirdparty/Placeholders.js
vendored
Submodule
@ -0,0 +1 @@
|
||||
Subproject commit 50833cedc22e2de8061ecdc2fb8f93347ccf30ed
|
Loading…
x
Reference in New Issue
Block a user