From 2179389da37fcfd20f3b7dfa329f586494cbe160 Mon Sep 17 00:00:00 2001 From: Ingo Schommer Date: Mon, 12 Apr 2010 03:31:02 +0000 Subject: [PATCH] BUGFIX: removed name attribute from label fields since this is invalid html. Ticket: #4887. PATCH via tobych (from r97013) git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@102418 467b73ca-7a2a-4603-9d3b-597d59a354a9 --- forms/LabelField.php | 3 +-- tests/fieldtypes/LabelFieldTest.php | 13 +++++++++++++ 2 files changed, 14 insertions(+), 2 deletions(-) create mode 100644 tests/fieldtypes/LabelFieldTest.php diff --git a/forms/LabelField.php b/forms/LabelField.php index 044313c52..f1f373ef7 100755 --- a/forms/LabelField.php +++ b/forms/LabelField.php @@ -37,8 +37,7 @@ class LabelField extends DatalessField { function Field() { $attributes = array( 'class' => $this->extraClass(), - 'id' => $this->id(), - 'name' => $this->Name(), + 'id' => $this->id() ); return $this->createTag( 'label', diff --git a/tests/fieldtypes/LabelFieldTest.php b/tests/fieldtypes/LabelFieldTest.php new file mode 100644 index 000000000..4e51b831f --- /dev/null +++ b/tests/fieldtypes/LabelFieldTest.php @@ -0,0 +1,13 @@ +assertEquals($field->Field(), ''); + } +}