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're retiring the forums!

The SilverStripe forums have passed their heyday. They'll stick around, but will be read only. We'd encourage you to get involved in the community via the following channels instead:

All other Modules /

Discuss all other Modules here.

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

userforms and translatable


Go to End


1492 Views

Avatar
engelsman

Community Member, 3 Posts

29 October 2009 at 10:39pm

i had to change the following code in userform.js in order to be able to add fields to a form in a different locale than the default:

var action = $("#Form_EditForm").attr("action") + '/field/Fields/addfield';

to this:

var orgAction = $("#Form_EditForm").attr("action");
var action = '';

if ( orgAction.indexOf( '?' ) != -1 ) {
action = orgAction.replace( '?', '/field/Fields/addfield?' );
}
else {
action = orgAction + '/field/Fields/addfield';
}

This makes sure the link for the add field button in the cms is not malformed.