Jump to:

2012 Posts in 1438 Topics by 621 members

Form Questions

SilverStripe Forums » Form Questions » Problem with internal labels displaying in Userform 0.2

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

Page: 1
Go to End
Author Topic: 1646 Views
  • rceee
    Avatar
    Community Member
    18 Posts

    Problem with internal labels displaying in Userform 0.2 Link to this post

    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?

  • rceee
    Avatar
    Community Member
    18 Posts

    Re: Problem with internal labels displaying in Userform 0.2 Link to this post

    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.

  • rceee
    Avatar
    Community Member
    18 Posts

    Re: Problem with internal labels displaying in Userform 0.2 Link to this post

    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?

  • rceee
    Avatar
    Community Member
    18 Posts

    Re: Problem with internal labels displaying in Userform 0.2 Link to this post

    Here's a screenshot. Hideous, no?

    Attached Files
    1646 Views
Page: 1
Go to Top

Want to know more about the company that brought you SilverStripe? Then check out SilverStripe.com

Comments on this website? Please give feedback.