2
每個input
字段對於總體測驗標記(input
字段)應該是相關的。我只想設置一個attribute: max
這應該是less than or equal to
總測驗標記。 我附上快照&我相信它會很清楚。 通過JQuery使輸入[數字]字段從屬於另一個輸入[數字]字段
&我還附上我的HTML代碼:
<form action="../controllers/classroom.php" method="POST">
<input type="number" class="form-control" id="totalMark" name="totalMark" placeholder="Enter quiz mark" required>
<div class="row">
<?php
$count=0;
$query4="SELECT * FROM enrollments WHERE classId='{$classId}'";
$res4=mysqli_query($connection, $query4);
while($row=mysqli_fetch_array($res4)){
$count++;
?>
<div class="col-md-2">#<?php echo $count; ?></div>
<div class="col-md-6"><?php echo ucwords(getUser($row['userId'])['name']); ?></div>
<div class="col-md-4"><input type="number" class="form-control" name="user[<?php echo $row['id']; ?>]" placeholder="Enter marks" required>
</div>
<?php } ?>
</div>
<button type="submit" name="quiz-marks" class="btn btn-primary">Submit</button>
</form>
我要讓現場驗證。謝謝
你救了我,先生,謝謝 –