- This topic has 1 reply, 2 voices, and was last updated 6 years ago by
jivedig.
-
AuthorPosts
-
-
January 25, 2016 at 7:26 pm #5750
mcmasterMemberMy client wants to be able to print out some information, so I’m using a really simple front-end form just to find out what she wants to print. I don’t need to save anything to the database; I just want to collect the info via $_POST.
Here’s the form:
<?php /* Title: Print Orders Method: post Message: Printing Orders */ /** * The shortcode for this form is: * [piklist_form form="print-orders" add_on="mcw-post-custom"] */ piklist('field', array( 'type' => 'radio', 'scope' => 'post_meta', 'field' => 'selection', 'label' => 'Select your report:', 'choices' => array( 'summaries' => 'Display a summary of all orders', 'printable' => 'Display all orders in printable format', 'single' => 'Print a single order in printable format', ), )); piklist('field', array( 'type' => 'text', 'scope' => 'post_meta', 'field' => 'order_id', 'label' => 'Order number: ', 'conditions' => array( array( 'scope' => 'post_meta', 'field' => 'selection', 'value' => 'single', ), ), )); // Submit button piklist('field', array( 'type' => 'submit', 'field' => 'submit', 'value' => 'Print Orders', 'attributes' => array( 'class' => 'btn btn-primary', ) ));I added the
scopefields as without them I couldn’t use the condition fororder_id.Problem: when I submit the form, I get the following order message:
Notice: Undefined index: post in /Users/donna/Sites/bentonswcd/wp-content/plugins/piklist/includes/class-piklist-form.php on line 3028I’m running Piklist 0.9.9.6, and that line is:
$field['object_id'] = $field['object_id'] ? $field['object_id'] : $object_ids[$meta_type];I’m really baffled. If I change the post comments to use
Method: getinstead of post, I don’t get the error message but I get a really ugly URL.Any clues where I’m goofing up?
Thanks!
Donna -
January 26, 2016 at 12:28 am #5751
jivedigMemberJust jumping in as I’ve been playing with forms quite a bit lately. Try setting the scope to a random string (the same for each). That will allow you to do whatever you want with the data (or in your case, not save it anywhere.
-
-
AuthorPosts
- You must be logged in to reply to this topic.