diff --git a/forms/FormField.php b/forms/FormField.php index c1438e9f1..80cfc99d9 100644 --- a/forms/FormField.php +++ b/forms/FormField.php @@ -125,7 +125,7 @@ class FormField extends RequestHandler { */ public function __construct($name, $title = null, $value = null) { $this->name = $name; - $this->title = ($title === null) ? $name : $title; + $this->title = ($title === null) ? self::name_to_label($name) : $title; if($value !== NULL) $this->setValue($value); diff --git a/tests/forms/FormTest.php b/tests/forms/FormTest.php index d97257a1f..fbbcea1d7 100644 --- a/tests/forms/FormTest.php +++ b/tests/forms/FormTest.php @@ -211,7 +211,7 @@ class FormTest extends FunctionalTest { $this->assertPartialMatchBySelector( '#SomeRequiredField span.required', array( - '"SomeRequiredField" is required' + '"Some Required Field" is required' ), 'Required fields show a notification on field when left blank' );