Codeigniter表单未提交

时间:2017-03-01 13:31:33

标签: php forms codeigniter

我正在创建一个网站联系表单。这是我的代码

<?=
form_open(site_url('contactus'), array(
    "id" => "contact_form",
    "class" => "form-horizontal",
    "name" => 'contact_form',
    "role" => 'form',
    'autocomplete' => 'off'
))
?>
<div class="row">
    <div class="col-lg-6">
        <input class="form-control" required="required" type="text" name="name" id="name" value="" size="40" aria-required="true" aria-invalid="false" placeholder="Your name here">

    </div>
    <div class="col-lg-6">
        <input class="form-control" required="required" type="email" name="email" id="email" value="" size="40" aria-required="true" aria-invalid="false" placeholder="Your email">

    </div>
    <div class="col-lg-6">
        <input class="form-control" required="required" type="text" name="subject" id="subject" value="" size="40" aria-invalid="false" placeholder="Subject">

    </div>

    <div class="col-lg-6">
        <input class="form-control" required="required" type="text" name="phone" id="phone" value="" size="40" aria-required="true" aria-invalid="false" placeholder="Phone">

    </div>
    <div class="col-xs-12">
        <textarea class="form-control" required="required" name="message" id="message" cols="40" rows="4" aria-invalid="false" placeholder="Your message"></textarea>

    </div>
    <div class="col-xs-12">
        <input class="btn btn-primary" type="submit" value="SEND MESSAGE">
    </div>
</div>
<?= form_close() ?>

单击“提交”时,表单未提交。知道为什么吗?

编辑:这是我呈现的表单

<form action="http://localhost/omanpost/contactus" id="contact_form" class="form-horizontal" name="contact_form" role="form" autocomplete="off" method="post" accept-charset="utf-8">
<input name="jaisud98374yihfi928hf" value="6a0eb5820d293015b087fecc73986dec" style="display:none;" type="hidden">
                    <div class="row">
                        <div class="col-lg-6">
                            <input class="form-control" required="required" name="name" id="name" value="" size="40" aria-required="true" aria-invalid="false" placeholder="Your name here" type="text">

                        </div>
                        <div class="col-lg-6">
                            <input class="form-control" required="required" name="email" id="email" value="" size="40" aria-required="true" aria-invalid="false" placeholder="Your email" type="email">

                        </div>
                        <div class="col-lg-6">
                            <input class="form-control" required="required" name="subject" id="subject" value="" size="40" aria-invalid="false" placeholder="Subject" type="text">

                        </div>

                        <div class="col-lg-6">
                            <input class="form-control" required="required" name="phone" id="phone" value="" size="40" aria-required="true" aria-invalid="false" placeholder="Phone" type="text">

                        </div>
                        <div class="col-xs-12">
                            <textarea class="form-control" required="required" name="message" id="message" cols="40" rows="4" aria-invalid="false" placeholder="Your message"></textarea>

                        </div>
                        <div class="col-xs-12">
                            <input class="btn btn-primary" id="contact_button" value="SEND MESSAGE" type="submit">
                        </div>
                    </div>
                    </form>

0 个答案:

没有答案