Forms 在数据库codeigniter中插入值时,“提交”按钮不起作用

Forms 在数据库codeigniter中插入值时,“提交”按钮不起作用,forms,codeigniter,Forms,Codeigniter,我在codeigniter中创建了一个表单。我不知道发生了什么。当我单击“提交”时,我的“提交”按钮不起作用 以下是我的查看代码: <form method="post" action="<?php echo base_url().'Candidate/candidate_process' ?>"> <b>Date </b>:<input type="text" name="date" id="date"><br>

我在codeigniter中创建了一个表单。我不知道发生了什么。当我单击“提交”时,我的“提交”按钮不起作用

以下是我的查看代码:

<form method="post" action="<?php echo base_url().'Candidate/candidate_process' ?>">

    <b>Date </b>:<input type="text" name="date" id="date"><br><br>

    <div class="form-group">

        <label>Choose  Candidate</label>
        <select class="form-control" name="candidate_id">
            <option value="" disabled selected>Select Candidate</option>

            <?php foreach($candidate as $rows) { ?>
            <option value="<?php echo $rows->candidate_id?>"><?php echo ucfirst($rows->first_name)?></option>
            <?php } ?>

        </select>
    </div><br></br>



    <div class="form-group">

        <label>Choose  Vendor</label>
        <select class="form-control" name="user_id">
            <option value="" disabled selected>Select Vendor</option>

            <?php foreach($usertype as $rows) { ?>
            <option value="<?php echo $rows->user_id?>"><?php echo ucfirst($rows->first_name)?></option>
            <?php } ?>

        </select>
    </div><br></br>


    <div class="form-group">
        <label><b>Select Status:</b></label>
        <select class="form-control" name="status_type_id">
            <option value="" disabled selected>Status Type</option>

            <?php foreach($statustype as $rows) { ?>
            <option value="<?php echo $rows->status_type_id?>"><?php echo ucfirst($rows->status)?></option>
            <?php } ?>

        </select>
    </div><br>

    <div class="form-group">
        <label><b>Select Interview Type:</b></label>
        <select class="form-control" name="selection_id">
            <option value="" disabled selected>Interview Type</option>

            <?php foreach($interviewtype as $rows) { ?>
            <option value="<?php echo $rows->interview_type_id?>"><?php echo ucfirst($rows->interview_type_name)?></option>
            <?php } ?>

        </select>
    </div><br>

    <div class="form-group">
        <label><b>Selection Process:</b></label>
        <select class="form-control" name="selection_process_id">
            <option value="" disabled selected>Selection Process Type</option>

            <?php foreach($selectionprocess as $rows) { ?>
            <option value="<?php echo $rows->selection_process_id?>"><?php echo ucfirst($rows->selection_process)?></option>
            <?php } ?>

        </select>
    </div><br>

    <button type="button" name="submit" value="submit" class="btn btn-primary">Submit</button>

</form>
型号:

public function add_candidate_selection($data){ 
    $data=array(
        'candidate_id'=>$this->input->post('candidate_id'),
        'user_id'=>$this->input->post('user_id'),
        'status_type_id'=>$this->input->post('status_type_id'),
        'interview_type_id'=>$this->input->post('interview_type_id'),
        'selection_process_id'=>$this->input->post('selection_process_id'),
        'date'=>$this->input->post('date')

        );
    $this->db->insert('candidate_selection', $data);
}
有人能帮我吗?我没有弄错。按钮类型必须是submit


ya类型仅在提交中?是。您必须设置要提交的按钮类型。
public function add_candidate_selection($data){ 
    $data=array(
        'candidate_id'=>$this->input->post('candidate_id'),
        'user_id'=>$this->input->post('user_id'),
        'status_type_id'=>$this->input->post('status_type_id'),
        'interview_type_id'=>$this->input->post('interview_type_id'),
        'selection_process_id'=>$this->input->post('selection_process_id'),
        'date'=>$this->input->post('date')

        );
    $this->db->insert('candidate_selection', $data);
}
<button type="submit" name="submit" value="submit" class="btn btn-primary">Submit</button>