Advertisement
Guest User

Untitled

a guest
Apr 20th, 2014
47
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.60 KB | None | 0 0
  1. $('input.preview').on('click', function(e){
  2. e.preventDefault();
  3. $('#form').hide();
  4. category_id = $('#category_id').val();
  5. $('#previewArea').empty().html('Category: '+category_id).show();
  6. });
  7.  
  8. <div id="previewArea"></div>
  9. <div id="form">
  10. <select name="category_id" id="category_id">
  11. <?php $res = mysql_query("SELECT * FROM `posts`");
  12. while($row14 = mysql_fetch_assoc($res)){
  13. echo '<option value="'.$row['id'].'">'.$row['name'].'</option>';
  14. } ?>
  15. </select>
  16. </div>
  17.  
  18. <input class="preview" type="button" value="Preview">
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement