Change register button label when certain field is selected I use a custom module to change the text of my register form submit button:

&lt;?php
function registration_button_override_form_alter(&amp;$form, &amp;$form_state, $form_id)
{
  //check to see if user is logged in so that this is only displayed to anon users that are registering
     global $user;
     if ($user-&gt;uid == 0) {
     if ($form_id == 'user_register_form') {

     // Change register button text.
     $form['actions']['submit']['#value'] = t('Jetzt registrieren'); 

     }
  }
}
?&gt;


This works fine. Now, I try to adjust this code that the button label text changes if a certain field on the registration form has a certain value selected.

I added this line:

if (isset($row-&gt;field_data_field_registrierung_als[0]['value']) == 1)


This doesn't work. When thinking about it the form probably should load again in order to change the text, right? Does somebody know how this could be done? 

EDIT:

My HTML:

&lt;select id="edit-field-registrierung-als-und" name="field_registrierung_als[und]" class="form-select required"&gt;
&lt;option value="_none"&gt;- Wert wählen -&lt;/option&gt;
&lt;option value="1"&gt;A&lt;/option&gt;
&lt;option value="2"&gt;B&lt;/option&gt;
&lt;/select&gt;

&lt;input id="edit-submit--2" name="op" value="Neues Benutzerkonto erstellen" class="form-submit" type="submit"&gt;


My jQuery:

(function ($) {
$("#edit-field-registrierung-als").change(function() {
if $( this.value == "2")
$("#edit-submit--2").val("Registrieren");
}
}) (jQuery);
First of all you don't need to check if isset is equals 1.

Then I think you must use the form_state or do this with jQuery, like this:

if(document.getElementById('checkbox-is').checked) {
  $("#submit-id").text("Jetzt registrieren");
}


UPDATE: I have edited your code to look like this:

(function ($) {
  $("#edit-field-registrierung-als").change(function() {
    if ($(this).value == "2") {
      $("#edit-submit--2").val("Registrieren");
    }
  }
}) (jQuery);