Send hidden fields with mail
-
Hello,
First of all thank you for making this plugin. It helps me alot! Unfortunately I ran upon a problem with sending the mail. I made a wizard with questions and in the end the user can send a email to me for a appointment. During the wizard I created a jQuery function which dynamicly changes some hidden fields in the ‘end’ form. In the form are some basic questions like name and email.
When I send the mail, every basic input is succesfully send. But the hidden input fields aren’t.
Can somebody help me?
The send-a-mail function (which works fine, but no hidden input values are send)
function handle_aircokiezer_submission( $form, $fields, $args ) { $to = '[email protected]'; $subject = 'Thank you for your reaction'; $headers = "From: [email protected]\r\n"; $headers .= "MIME-Version: 1.0\r\n"; $headers .= "Content-Type: text/html; charset=ISO-8859-1\r\n"; $message = '<html><body>'; $message .= '<h1>This is a test!</h1>'; $message .= '<table>'; $message .= '<tr><th>Fieldname</th><th>Data</th></tr>'; $message .= '<tr><td>Name</td><td>' . af_get_field( 'firstname' ) . ' ' . af_get_field( 'lastname' ) . '</td></tr>'; // This works fine $message .= '<tr><td>E-mail</td><td>' . af_get_field( 'E-mailadres' ) . '</td></tr>'; // This works fine $message .= '<tr><td>Innerparts</td><td>' . af_get_field( 'hiddenInnerparts' ) . '</td></tr>'; // This doesn't work $message .= '<tr><td>Room 1 size</td><td>' . af_get_field( 'hiddenRoom1Size' ) . '</td></tr>'; // This doesn't work $message .= '<tr><td>Room 1 heating</td><td>' . af_get_field( 'hiddenRoom1Heating' ) . '</td></tr>'; // This doesn't work mail($to, $subject, $message, $headers); }
The create-hidden-inputs function:
function hidden_field( $form, $args ) { echo '<input type="hidden" name="hiddenInnerparts" value="1">'; echo '<input type="hidden" name="hiddenRoom1Size" value="2">'; echo '<input type="hidden" name="hiddenRoom1Heating" value="3">'; } add_action( 'af/form/hidden_fields/key=form_5a997b9a7925a', 'hidden_field' );
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- The topic ‘Send hidden fields with mail’ is closed to new replies.