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.

All other Modules /

Discuss all other Modules here.

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

userforms and translatable


Go to End


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