• 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)
  • Where did you get this from ‘code’ from? HTML forms can be reviewed at several online sites. Please look there. Note: ‘action’ belongs with the ‘form’, not the ‘input’…and has a specific usage..

    Thread Starter boris16584

    (@boris16584)

    thank you for the comment

    how can i achieve something like this

    i want to submit two select categories in the options.php and get the values in my front-page to show posts from spacified category that the user will choose

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.