BUGFIX: removed name attribute from label fields since this is invalid html. Ticket: #4887. PATCH via tobych

git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/branches/2.4@97013 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
Will Rossiter 2010-01-15 02:23:03 +00:00 committed by Sam Minnee
parent 5ce693ce40
commit 1125de1b99
2 changed files with 14 additions and 2 deletions

View File

@ -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',

View File

@ -0,0 +1,13 @@
<?php
/**
* @package sapphire
* @subpackage tests
*/
class LabelFieldTest extends SapphireTest {
function testFieldHasNoNameAttribute() {
$field = new LabelField('MyName', 'MyTitle');
$this->assertEquals($field->Field(), '<label id="MyName">MyTitle</label>');
}
}