I have form field name like

name="commerce_discount_fields[commerce_discount_offer][und][form][commerce_fixed_amount][und][0][amount]" value="" size="10" maxlength="128" class="form-text required" type="text">

How to get value in form alter???


Use the following code in validate or submit to get the % off form field value.

$value = $form_state['values']['commerce_discount_fields']['commerce_discount_offer'][LANGUAGE_NONE]['form']['commerce_percentage'][LANGUAGE_NONE][0]['value'];

Hope this will help you.


I guess that like this


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy