Add enctype to form
-
Hi all.
I need to add a upload file a form module.
I have implemented this code and working fine<?php /** * Make the Give Donation form a multipart/form-data form * */ function give_add_multipart_tag_donation_form( $final_output, $args ) { $form_tag = "<form id=\"give-form-{$args['form_id']}-1\""; $final_output = str_replace( $form_tag, "{$form_tag} enctype=\"multipart/form-data\"", $final_output ); return $final_output; } add_filter( 'give_donate_form', 'give_add_multipart_tag_donation_form', 10, 2 );
The problem arises when, in the same page, i have more form module.
The form id is so composed<form id=”give-form-XXXXX-n”>
where
– XXXXX is the form-id;
– n is a progressive form number;I don’t know how to do to implement the dynamic “n” in the code above.
Can you help me?
Regards,
MarcoThe page I need help with: [log in to see the link]
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
- The topic ‘Add enctype to form’ is closed to new replies.