FEATURE: make PasswordField and ConfirmedPasswordField able to either readonly or disabled.

git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/branches/2.3@74538 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
Normann Lou 2009-04-15 05:22:20 +00:00 committed by Sam Minnee
parent 12e2c9cda1
commit 786b777e0e

View File

@ -25,9 +25,9 @@ class PasswordField extends FormField {
function Field() {
$disabled = $this->isDisabled()?"disabled=\"disabled\"":"";
$readonly = $this->isReadonly()?"readonly=\"readonly\"":"";
if($this->maxLength) {
$disabled = $this->isDisabled()?"disabled=\"disabled\"":"";
$readonly = $this->isReadonly()?"readonly=\"readonly\"":"";
return "<input class=\"text\" type=\"password\" id=\"" . $this->id() .
"\" name=\"{$this->name}\" value=\"" . $this->attrValue() .
"\" maxlength=\"$this->maxLength\" size=\"$this->maxLength\" $disabled $readonly />";