Ariex
Ariex

Reputation: 76

get client side element ID of a Field in SilverStripe

In asp.net, server side control have a property called ClientID, which can be used to get the id that template engine generated for a server side control, is there a similar thing in SilverStripe, to get the id of the input element rather than its .field wrapper?

thanks

Upvotes: 1

Views: 113

Answers (1)

Gavin Bruce
Gavin Bruce

Reputation: 1809

Have a look at the ID method of FormField

http://api.silverstripe.org/3.1/class-FormField.html

In your templates, you should be able to use

$Fields.FieldByName(FieldName).ID

Upvotes: 1

Related Questions