Jump to:

10845 Posts in 2513 Topics by 1792 members

All other Modules

SilverStripe Forums » All other Modules » userforms and translatable

Discuss all other Modules here.

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

Page: 1
Go to End
Author Topic: 1080 Views
  • engelsman
    Avatar
    Community Member
    3 Posts

    userforms and translatable Link to this post

    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.

    1080 Views
Page: 1
Go to Top

Want to know more about the company that brought you SilverStripe? Then check out SilverStripe.com

Comments on this website? Please give feedback.