I have used the following form alter to do some adjustments to my form but after the file upload stops working. I cant seem to find out why. This is the module code.

Any help would be much appreciated.

if ($form_id == 'webform_client_form_3'){
    //image btn
    $form['actions']['submit']['#type'] = 'image_button';   
    $form['actions']['submit']['#src'] = drupal_get_path('theme', 'MY_THEME').'/images/submit2.png';
    $form['actions']['submit']['#attributes']['name'][] = 'op'; 

    $form['submitted']['forename']['#attributes']['placeholder'] = t('Forename'); 
    $form['submitted']['surname']['#attributes']['placeholder'] = t('Surname'); 
    $form['submitted']['post_code']['#attributes']['placeholder'] = t('Post Code'); 


I fixed this by forcing the the 'op' value to

 $form['actions']['op'] = array( '#type' => 'value', '#value' => 'Submit', ); 

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.