Jump to:

1970 Posts in 1275 Topics by 607 members

Form Questions

SilverStripe Forums » Form Questions » How to modify the HTML ID of a field's div container ?

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

Page: 1
Go to End
Author Topic: 1028 Views
  • Myrdhin
    Avatar
    Community Member
    67 Posts

    How to modify the HTML ID of a field's div container ? Link to this post

    Hello,

    I've 2 differents forms in a page but i've a TextField with same FieldName in each forms. The problem is the IDs of their div container : they are identical

    Default *Field template is :

    <div id="[FieldName]" ...>
       <label ... > ... </label>
       <div ... >
          <input name="[FieldName]" id="[FormName_FieldName]" ... >
       </div>
    </div>

    If i've two forms containing *Field with same FieldName in the same page, we'll have 2 same IDs in the same page...

    How to modify this IDs ?

    Thanks,

  • Willr
    Avatar
    Forum Moderator
    5462 Posts

    Re: How to modify the HTML ID of a field's div container ? Link to this post

    Call the form field something else if you can edit the form fields. Are they 2 different form functions or 2 of the same on?

  • Myrdhin
    Avatar
    Community Member
    67 Posts

    Re: How to modify the HTML ID of a field's div container ? Link to this post

    Hello Willr,

    It's 2 different form functions so i think i could edit the ID of fields with $name param... I'll try.
    Thanks for your help,

    1028 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.