Input field visible, but no data in $_POST
-
Hi,
I entered a form in my template page as follows:<?php $sc = '[fu-upload-form class="your-class" title="1) Upload your Travel photographs"]'; $sc .= '[input type="file" name="photo" id="ug_photo" class="required" description="" multiple="true"]'; $sc .= '[input type="text" name="destinationField" id="destinationField" class="required" description="<h2 class=destination>2) Type your Destination here:</h2>" ]'; $sc .= '[input type="submit" class="btn" id="submission" value="3) Let MyTravelLog build Your Blog!"]'; $sc .= '[/fu-upload-form]'; echo do_shortcode($sc); ?>
In the resulting page, I see the “destination” input field, it looks like this in the html:
<input type="text" class="required" id="destinationField" name="destinationField" value="">
BUT after entering data in the field and submitting, in Netbeans I see:
* nothing in the$_POST
variable in $Superglobals
* nothing in$_GET
apart from frompost_type
,p
andresponse
(default frontend fields).Attempt at solving: after reading another support issue, I tried adding this to functions.php:
/* from https://www.ads-software.com/support/topic/unable-to-view-content-placed-in-custom-fields?replies=5*/
add_action( ‘init’, ‘my_add_metaboxes’ );
function my_add_metaboxes() {
add_post_type_support( ‘attachment’, array( ‘destinationField’ ) );
}
- The topic ‘Input field visible, but no data in $_POST’ is closed to new replies.