0

Below is my dialogue code and the issue is that when I submit it doesn't show error and it get's closed I want to shoe that error on that form itself. I have used form validation where it doesn't works and it only doesn't work on this particular model

<div class="modal fade" id="modal1" data-open-click="true" data-open-delay="2500" tabindex="-1" role="dialog">
    <div class="modal-dialog modal-lg" role="document">
        <div class="modal-content">
            <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
            <div class="modal-body">
                <div class="row">
                    <div class="col-md-12">
                        <h2 class="heading"><span class="color2">FEEDBACK </span>FORM</h2>

                        <form role="form" action="<?php echo base_url();?>home/add_record" method="post">
                            <div class="form-group">
                                <label for="contact-name">Name</label>
                                <input name="name" id="<?php if(isset($record[0]['feed_name'])){echo $record[0]['feed_name'];}?>" type="text" class="form-control" value="<?php if(isset($record[0]['feed_name'])){ echo $record[0]['feed_name']; }else{ echo set_value('name'); } ?>">
                                <div class="clearfix"></div>
                                <?php if(form_error('name')!=""){ echo form_error('name');} ?>
                            </div>
                            <div class="form-group">
                                <label for="mobile">Mobile</label>
                                <input name="mobile" id="<?php if(isset($record[0]['feed_mobile'])){echo $record[0]['feed_mobile'];}?>" type="text" class="form-control" value="<?php if(isset($record[0]['feed_mobile'])){ echo $record[0]['feed_mobile']; }else{ echo set_value('mobile'); } ?>">
                            </div>
                            <div class="form-group">
                                <label for="email">Email ID</label>
                                <input name="email" id="<?php if(isset($record[0]['feed_email'])){echo $record[0]['feed_email'];}?>" type="text" class="form-control" value="<?php if(isset($record[0]['feed_email'])){ echo $record[0]['feed_email']; }else{ echo set_value('email'); } ?>">
                                <div class="clearfix"></div>
                                <?php if(form_error('email')!=""){ echo form_error('email');} ?>
                            </div>
                            <div class="form-group">
                                <label for="feedback">Feedback</label>
                                <textarea class="form-control" id="feedback" name="feedback" rows="3"><?php if(isset($record[0]['feed_desc'])){ echo $record[0]['feed_desc']; }else{ echo set_value('feedback'); } ?></textarea>
                            </div>
                            <button type="submit" class="btn btn-success">Submit</button>
                            <a href="<?php echo base_url();?>" class="btn btn-danger"> Cancel </a>
                        </form>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
5
  • without your javascript, it's impossible to know what's happening, but guess what? If you put a type=submitinside a form, it will submit your form by default, so it will send the page action to home/add_record Commented Feb 22, 2017 at 10:04
  • but I want to store the data from the form and without submit how can I do that Commented Feb 22, 2017 at 10:33
  • And I have Used Bootstrap dialogue box Commented Feb 22, 2017 at 10:35
  • you have to use a javascript ajax function. It should call your php page that stores the data and returns a result to your function. So, that will, you don't need to reload the client page. Take a look at this stackoverflow.com/questions/5150571/… Commented Feb 22, 2017 at 11:05
  • I am using Code Igniter where I am not able to understand what URL should I give Commented Feb 22, 2017 at 12:15

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.