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.

All other Modules /

Discuss all other Modules here.

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

Userforms - Why can I not assign ID's/Names to the fields?


Reply


2 Posts   612 Views

Avatar
Garrett

Community Member, 245 Posts

25 January 2011 at 9:03am

Using Silverstripe for forms has always been a problem for my development (read: I haven't been able to use them) because of the seemingly random form field names which are generated in the HTML by the Userforms module. How can I ever expect to hook my forms up to other systems (for example, SalesForce) if I can't control the names/IDs of the fields?

I need users to be able to create their own forms for marketing and for my processing of these forms to be a pre-written XML parser. I can't create an XML document (to be parsed at a given URL by another system) and then put these results in that database if I have no idea what the fields are going to be called. What do other people do in this situation?

//Garrett

Avatar
Willr

Forum Moderator, 5513 Posts

26 January 2011 at 9:11pm

You could extend your UDF to have a special field for ID - See this patch for an example of adding a field to each form field http://silverstripe.org/all-other-modules/show/15539#post298071.

The reason for the automatic ID's is that UDF is designed for content editors, allowing total flexibility makes the backend layout really complex really quickly so I'm trying to keep the core UDF nice and simply for most users. Hope that link guides in the right direction though.