mirror of
https://github.com/silverstripe/silverstripe-userforms.git
synced 2024-10-22 17:05:42 +02:00
parent
f029bfcc61
commit
14b7c65859
@ -173,4 +173,12 @@ class UserForm extends Form {
|
||||
|
||||
return $attrs;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
public function getButtonText() {
|
||||
return $this->config()->get('button_text');
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -311,6 +311,7 @@ SQL;
|
||||
public function getCMSValidator() {
|
||||
return new UserFormValidator();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -83,4 +83,13 @@ UserDefinedForm:
|
||||
email_template_directory: your/template/path/
|
||||
````
|
||||
|
||||
Any SilverStripe templates placed in your `email_template_directory` directory will be available for use with submission emails.
|
||||
Any SilverStripe templates placed in your `email_template_directory` directory will be available for use with submission emails.
|
||||
|
||||
### Custom Multi-Step button Text
|
||||
|
||||
If you want to change the button text when using the Multi-Step/Page Break feature, simply add the following to your `config.yml`:
|
||||
|
||||
````
|
||||
UserForm:
|
||||
button_text: 'Your Text Here'
|
||||
````
|
@ -464,7 +464,7 @@ jQuery(function ($) {
|
||||
this.$buttons.each(function (i, stepButton) {
|
||||
$(stepButton).on('click', function (e) {
|
||||
e.preventDefault();
|
||||
self.$el.trigger('userform.progress.changestep', [parseInt($(this).text(), 10)]);
|
||||
self.$el.trigger('userform.progress.changestep', [parseInt($(this).data('step'), 10)]);
|
||||
});
|
||||
});
|
||||
|
||||
@ -548,7 +548,7 @@ jQuery(function ($) {
|
||||
var $element = $(element),
|
||||
$item = $element.parent();
|
||||
|
||||
if (parseInt($element.text(), 10) === stepNumber && $element.is(':visible')) {
|
||||
if (parseInt($element.data('step'), 10) === stepNumber && $element.is(':visible')) {
|
||||
$item.addClass('current viewed');
|
||||
$element.removeAttr('disabled');
|
||||
|
||||
|
@ -9,7 +9,7 @@
|
||||
<% loop $Steps %>
|
||||
<li class="step-button-wrapper<% if $First %> current<% end_if %>" data-for="$Name">
|
||||
<%-- Remove js-align class to remove javascript positioning --%>
|
||||
<button class="step-button-jump js-align" disabled="disabled">$Pos</button>
|
||||
<button class="step-button-jump js-align" disabled="disabled" data-step="$Pos"><% if $Top.ButtonText %>$Top.ButtonText <% end_if %>$Pos</button>
|
||||
</li>
|
||||
<% end_loop %>
|
||||
</ul>
|
||||
|
Loading…
Reference in New Issue
Block a user