php 表单验证HTML控件但不在CodeIgniter 4中提交

kulphzqa  于 2023-01-19  发布在  PHP
关注(0)|答案(1)|浏览(112)

我用CodeIgniter 4框架开发了一个网站。一个特定的页面有一个表单,它不提交,但验证具有所需属性的HTML输入控件。我尝试了所有方法,但无法找到确切的错误。以下是该页面的实时URL:https://spcollegedumka.ac.in/index.php/feedback/send

<form method="post" id="feedbackForm">
                        <div class="mb-2">
                            <label class="form-label">Who you are?</label>
                            <select name="category" class="form-control form-control-sm" required="">
                                <option value="" selected="" disabled="">---- Select ----</option>
                                <option value="Student">Student</option>
                                <option value="Parent">Parent</option>
                                <option value="Guest">Guest</option>
                            </select>
                        </div>
                        <div class="mb-2">
                            <label class="form-label">Your Name</label>
                            <input type="text" name="name" class="form-control form-control-sm" required="">
                        </div>
                        <div class="mb-2">
                            <label class="form-label">Roll No. (students only)</label>
                            <input type="text" name="roll" class="form-control form-control-sm">
                        </div>
                        <div class="mb-2">
                            <label class="form-label">Select Faculty</label>
                            <select name="faculty" class="form-control form-control-sm" required="">
                                <option value="" selected="" disabled="">---- Select ----</option>
                                                                                                    <option value="1">Faculty of Humanities</option>
                                                                    <option value="2">Faculty of Social Science</option>
                                                                    <option value="3">Faculty of Commerce</option>
                                                                    <option value="4">Faculty of Science</option>
                                                                <option value="100">Not Applicable (For Parent/Guest)</option>
                                                            </select>
                        </div>
                        <div class="row">
                            <div class="col-md-6">
                                <div class="mb-2">
                                    <label class="form-label">Mobile No.</label>
                                    <input type="text" name="mobile" class="form-control form-control-sm" required="">
                                </div>
                            </div>
                            <div class="col-md-6">
                                <div class="mb-4">
                                    <label class="form-label">Email Address</label>
                                    <input type="email" name="email" class="form-control form-control-sm" required="">
                                </div>
                            </div>
                        </div>
                        <button type="submit" value="submit" class="btn btn-sm">SUBMIT & GO NEXT</button>                       
                    </form>
l7wslrjt

l7wslrjt1#

我不知道你是什么意思,但尝试阅读属性要求

required="true"
or 
required

https://www.w3schools.com/tags/att_input_required.asp

相关问题