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've moved the forum!

Please use forum.silverstripe.org for any new questions (announcement).
The forum archive will stick around, but will be read only.

You can also use our Slack channel or StackOverflow to ask for help.
Check out our community overview for more options to contribute.

Form Questions /

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

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


Go to End


3 Posts   1786 Views

Avatar
Myrdhin

Community Member, 70 Posts

25 June 2010 at 11:07am

Edited: 25/06/2010 11:10am

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,

Avatar
Willr

Forum Moderator, 5523 Posts

26 June 2010 at 3:48pm

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?

Avatar
Myrdhin

Community Member, 70 Posts

28 June 2010 at 5:13am

Edited: 28/06/2010 5:41am

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,