I need to change the submit button value (text) based on the selection made in a certain register form field. I accomplished this by using jQuery:
(function ($) {
$(function() {
$("#edit-field-registrierung-als-und").change(function() {
if ( this.value == "2") {
$("#registersubmit").val("Kostenpflichtig registrieren");
}
else {
$("#registersubmit").val("Jetzt registrieren");
}
});
});
}(jQuery));
The submit button value changes as expected. But the form is not sent anymore after submitting. The page refreshes and the entered data is still in there. I don't get any error in the console or error log. I think drupal expects the very term and is 'confused' to get a different one. Does somebody know how to resolve this?
This is my register page: https://my-business-location.com/registrierung The first field on the page influences the submit button value (option 2).