options.php multiple select with options in a submit form
-
here are my code
$categories = get_categories( $args ); ?> <div class="wrap"> <h2>Theme Options</h2> <form id="categoris_post" method="post" action="options.php"> <?php wp_nonce_field('update-options'); // Security - used to validate source. ?> <p><strong>first posts:</strong></p> <select id="posts_by_category" class="postform" name="first" value="<?php echo get_option('first');?>"> <option value="">All</option> <?php foreach ( $categories as $category ) {?> <option class="level-0" value="<?php echo $category->name;?>"><?php echo $category->name;?></option> <?php }?> </select> <p><strong>second posts:</strong></p> <select id="recent_post" class="postform" name="second" value="<?php echo get_option('second');?>"> <option value="">All</option> <?php foreach ( $categories as $category ) {?> <option class="level-0" value="<?php echo $category->name;?>"><?php echo $category->name;?></option> <?php }?> </select> <p><input type="submit" name="Submit" value="Save Options" /></p> <input type="hidden" name="action" value="update" /> <input type="hidden" name="page_options" value="first" /> <input type="hidden" name="page_options" value="second" /> </form> </div>
i want to submit the two values from the selectors
please help
thank you
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
- The topic ‘options.php multiple select with options in a submit form’ is closed to new replies.