submitting relational values of a post type to custom field of another post type
-
Hi,
I’m preparing a small quiz module.
This is my code<!-- New Post Form --> <div id="postbox"> <form id="new_post" name="new_post" method="post" action=""> <p><label for="title">Title</label><br /> <input type="hidden" id="title" value="<?php the_title(); ?>" tabindex="1" size="20" name="title" /> </p> <?php $my_array = get_custom_field('selectquestions:to_array'); foreach ($my_array as $item) { $args = array( 'p' => $item, 'order' => 'ASC' ); echo '<h5>'.get_the_title($item) . '</h5><br>'; echo '<input type="radio" value="A" id="opt_A" name="opt_'.$item.'" />'.get_post_meta($item, 'textoptiona', true).'<br>'; echo '<input type="radio" value="B" id="opt_B" name="opt_'.$item.'" />'.get_post_meta($item, 'textoptionb', true).'<br><hr>'; } ?> <input type="submit" value="Post Review" tabindex="40" id="submit" name="submit" /> <input type="hidden" name="action" value="new_post" /> <?php wp_nonce_field( 'new-post' ); ?> </form> </div> <!-- New Post Form ENDS -->
which displays
question 1
[radio] Option A
[radio] Option Bquestion 2
[radio] Option A
[radio] Option Band so on..
now I want the values submitted by user to be stored somthing like this
[id of question1][option selected by user][right option of question1],
[id of question2][option selected by user][right option of question2],… and so on in one field.or any other way to store options so that a report can be generated at end ?
Thanks in Advance
http://wordpress.org/extend/plugins/custom-content-type-manager/
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- The topic ‘submitting relational values of a post type to custom field of another post type’ is closed to new replies.