我尝试使用bootstrap模式进行表单验证。我的想法是设计一个简介评估器,帮助学生将他的大学列入海外申请硕士学位。我的作品
想法是每当用户点击提交它应该打开一个模态
显示入围的大学。但是,最终用户无法点击
用空表格提交。所以,我已经添加了表单验证器,表示这些字段是必需的。即使我在点击时添加了这些字段
提交按钮,它打开模态而不显示"必填字段" .Below posted是我的代码。
<body>`
`<div class="demo">`
<form action="profileEvaluator.php" method="post" class = "cmxform"
id = "forrm" required/>
<fieldset>
<label for="speed" id="uel" required>Select your Area</label>
<select name="speed" id="speed">
<option>Kansas</option>
<option>Texas</option>
<option selected="selected">California</option>
</select>
<label for="files" id="uel">Select your field of Interest</label>
<select name="files" id="files">
<option value="jquery">Computer Science</option>
<option value="jqueryui">Electrical Engineering</option>
<option value = "jjjj">Mechanichal Engineering</option>
</select>
<label for="number" id="uel">Work Experience</label>
<select name="number" id="number">
<option >0</option>
<option selected="selected">1</option>
<option>2</option>
</select>
<label for ="number" id="uel">CGPA(or)GPA(or)Percentage:</label>
<input type="text" class="form-control"
placeholder="Example:70%,3/4,7.5/10" id="kanchu" required/>
<label for ="number" id="uel">GRE:</label>
<input type="text" name="gre" class="form-control"
placeholder="Example:300" id="kanchu" required/>
<div id= 'eat-me' style='display:none'>
<label for ="number" id="uel">Verbal:</label>
<input type="text" class="form-control" placeholder="Example:154"
id="ranju">
<label for ="number" id="uel">Quant:</label>
<input type="text" class="form-control" placeholder="Example:148"
id="ranju">
<label for ="number" id="uel">AWA:</label>
<input type="text" class="form-control" placeholder="Example:3.0"
id="ranju">
</div>
<label for = "number" id="uel" >Select Your Test</label>
<input type = "radio" name="test" value="TOEFL" id="vel"
required/>TOEFL</input>
<input type = "radio" name="test" value="IELTS" id="kel"
required/>IELTS</input>
</div>
<div id= 'show-me' style='display:none'>
<label for ="number" id="uel">IELTS:</label>
<input type="text" class="form-control" placeholder="Example:6.5"
id="ranju" reuqired/>
</div>
<div id = 'touch-me' style= 'display:none'>
<label for ="number" id="uel">TOFEL:</label>
<input type="text" class="form-control" placeholder="Example:300"
id="ranju" required/>
</div>
<div class = "input-group" id="kkk" title="upload your Resume">
<input type="file" class="filestyle" data-buttonName="btn-info"
data-input=false>
</div>
<div class = "input-group" id="vvv" title="click this please!!">
<input type = "submit" class = "btn btn-bitbucket" data-toggle =
"modal" href = "#myModel"> </input>
</div>
</fieldset>
</form>
<div class="bs-example">
<div id="myModel" class="modal fade">
<div class="modal-dialog">
<div class="modal-content">
`<div class="modal-header">
`<button type="button" class="close" data-
dismiss="modal" aria-hidden="true">×</button>
<h4 class="modal-title" align="center">report</h4>
</div>
<div class="modal-body">
<?php
$k=include_once 'connect.php';
$query = "select*from ecommerce.Universities";
$exec = mysqli_query($db,$query);
if($exec)
{
$y = mysqli_fetch_array($exec);
echo $y['UniversityId'];
}
else {
echo "bye";
}
?>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-
dismiss="modal">Close</button>
</div>
</div>
</div>
</div>
</div>
</body>