Preview Page before form submission using codeigniter php -
before submitting form there option previewing page user can check how form displaying in front end unable display preview option checking.
as have tried display form in popup before submission popup not displaying.
<script type= "text/javascript"> $(document).ready( function() { $('#submit').on('click', function(e) { e.preventdefault(); preview(); }); }); function preview(){ var text = $('input[name="blog_title"]').val(); var text_label = $('label[for="text"]').text(); var text_data = '<p><strong>' + text_label + '</strong> : ' + text + '</p>'; $('#preview_data').html(''); $('#preview_data').append(data); $('#preview_data').dialog({ resizable: false, //height:140, modal: true, buttons: { 'submit': function() { //submit form $(this).dialog("close"); }, cancel: function() { $(this).dialog("close"); } } }); } </script> <?php $form_attributes = array('name'=>'adds', 'id'=>'adds', 'enctype' => "multipart/form-data"); echo form_open('blogs/addblogs',$form_attributes); ?> <div class="element"> <label for="blogtitle"><font color ="black">blog title</font></label> <input class="text err" type="text" name="blog_title" id="blog_title" value="<?php echo set_value('blog_title');?>"/> </div> <div class="element"> <label for="description"><font color ="black">blog description</font></label> <textarea name="description" class="ckeditor" rows="4" cols="173"></textarea> </div> <br/> <div class="element"> <label for="blogwriter"><font color ="black">author </font></label> <input class="text err" type="text" name="blog_writer" id="blog_writer" value="<?php echo set_value('blog_writer');?>"/> </div> <div class="element"> <label><font color ="black">select image:</font></label> <input class="err" type="file" name="image_path" id="image_path"/> </div><br/> <div align="center"> <input type="submit" id="submit" value="submit" /> </div> <div class="clear"></div> <?php echo form_close();?>
Comments
Post a Comment