php - ddslick plugin: get value in wordpress -
i have choice menu in wordpress plug-in ddslick . want pass id of selected option , send form database , value not saved although appears within html . when put manual maintained.
<script type='text/javascript' src='http://g-page.co.il/wp-content/themes/g-page/js/jquery.ddslick.min.js'></script> <div id="mydropdown"> <select id="demo-htmlselect"> <?php $thumbnails = get_posts('numberposts=5'); foreach ($thumbnails $thumbnail) { $url = wp_get_attachment_url( get_post_thumbnail_id($thumbnail->id) ); ?> <option value="<?php echo $thumbnail->id;?>" data-imagesrc="<?php echo $url; ?>" data-description="<?php echo $thumbnail->post_title;?>"><?php echo $thumbnail->post_title;?></option> <?php } ?> </select> </div> <?php ?> <div class="wrap"> <form method="post" action="options.php"> <?php wp_nonce_field('update-options') ?> <input type="text" name="main_art_id" size="45" value="<?php echo get_option('main_art_id'); ?>" /> </p> <p><input type="submit" name="submit" value="store options" /></p> <input type="hidden" name="action" value="update" /> <input type="hidden" name="page_options" value="ain_art_id" /> </form> </div> <script type="text/javascript"> jquery(document).ready(function($) { $('#mydropdown').ddslick({ onselected: function(selecteddata){ var cor_val = selecteddata['selecteddata']['value']; $("input[name=main_art_id]").val(cor_val); } }); }); </script> <?php }
Comments
Post a Comment