Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $('input.preview').on('click', function(e){
- e.preventDefault();
- $('#form').hide();
- category_id = $('#category_id').val();
- $('#previewArea').empty().html('Category: '+category_id).show();
- });
- <div id="previewArea"></div>
- <div id="form">
- <select name="category_id" id="category_id">
- <?php $res = mysql_query("SELECT * FROM `posts`");
- while($row14 = mysql_fetch_assoc($res)){
- echo '<option value="'.$row['id'].'">'.$row['name'].'</option>';
- } ?>
- </select>
- </div>
- <input class="preview" type="button" value="Preview">
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement