Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

We're retiring the forums!

The SilverStripe forums have passed their heyday. They'll stick around, but will be read only. We'd encourage you to get involved in the community via the following channels instead:

Form Questions /

Moderators: martimiz, Sean, Ed, biapar, Willr, Ingo, swaiba

Problem with internal labels displaying in Userform 0.2


Go to End


4 Posts   2227 Views

Avatar
rceee

Community Member, 18 Posts

25 August 2009 at 9:38am

Edited: 25/08/2009 9:39am

I've installed the latest UserForm with SS 2.3.3.

Everything works great, including email and submissions.

However, SS is outputting the following for every form field:

<h2 class=" FormHeading" id="Form_Form_EditableFormHeading8" name="EditableFormHeading8">Your Email Address</h2>

<div id="EditableEmailField7" class="field email requiredField"><label class="left" for="Form_Form_EditableEmailField7">EditableEmailField7</label><div class="middleColumn"><input type="text" class="text requiredField" id="Form_Form_EditableEmailField7" name="EditableEmailField7" value="" /></div></div>

The problem is in that second bit... there's a label above each field like "EditableEmailField7"... I don't need this nor do I see a way to edit it in the Form editor. How can I remove this? Is there simply a template?

Avatar
rceee

Community Member, 18 Posts

25 August 2009 at 10:03am

Well... this might be the fix.

In /sapphire/forms/FormField.php, within the function FieldHolder(), I commented out the following line:

/* $titleBlock = (!empty($Title)) ? "<label class=\"left\" for=\"{$this->id()}\">$Title</label>" : ""; */

Nobody else seems to have had this problem, though. I wonder why my install was screwy in this regard? Anyway, this got rid of the unnecessary labels.

Avatar
rceee

Community Member, 18 Posts

26 August 2009 at 6:45am

Nope, that won't work. It kills all of the labels in the CMS as well. Why are these rendering out in the form's html?? How can I remove these junk labels?

Avatar
rceee

Community Member, 18 Posts

26 August 2009 at 6:49am

Here's a screenshot. Hideous, no?

Attached Files