mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 12:05:37 +00:00
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:
parent
5ce693ce40
commit
1125de1b99
@ -37,8 +37,7 @@ class LabelField extends DatalessField {
|
|||||||
function Field() {
|
function Field() {
|
||||||
$attributes = array(
|
$attributes = array(
|
||||||
'class' => $this->extraClass(),
|
'class' => $this->extraClass(),
|
||||||
'id' => $this->id(),
|
'id' => $this->id()
|
||||||
'name' => $this->Name(),
|
|
||||||
);
|
);
|
||||||
return $this->createTag(
|
return $this->createTag(
|
||||||
'label',
|
'label',
|
||||||
|
13
tests/fieldtypes/LabelFieldTest.php
Normal file
13
tests/fieldtypes/LabelFieldTest.php
Normal 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>');
|
||||||
|
}
|
||||||
|
}
|
Loading…
x
Reference in New Issue
Block a user