|
|
|
สอบถามการตรวจ From กรณีค่าว่าง ต้องแจ้ง แต่พอรับข้อมูลที่ Loop ชื่อไม่ส่งค่าครับ |
|
|
|
|
|
|
|
Code (PHP)
<?
$link = mysqli_connect("$hostname","$username","$password","$database");
$queryCleS = "SELECT * FROM student WHERE Cla_ID = '".$_REQUEST["Cla_ID"]."' and Roo_ID = '".$_REQUEST["Roo_ID"]."' ORDER by Tit_ID ASC,Stu_Code ASC";
if ($resultCleS = mysqli_query($link, $queryCleS)) {
$i=1;
while ($objCleS = mysqli_fetch_object($resultCleS)) {
//$link = mysqli_connect("$hostname","$username","$password","$database");
$queryCleC = "SELECT * FROM stuscore WHERE Stu_Code = '".$objCleS->Stu_Code."' and Ind_ID ='".$_REQUEST["Ind_ID"]."' and SchD_ID = '".$_REQUEST["SchD_ID"]."' ";
$resultCleC = mysqli_query($link, $queryCleC);
$rowCleC = mysqli_fetch_array($resultCleC, MYSQLI_ASSOC);
?>
<tr>
<td><?=++$ob?>
<input type="hidden" name="Stu_Code[]" value="<?=$objCleS->Stu_Code ?>">
</td>
<td><?
$query = "SELECT * FROM student WHERE Stu_Code = '".$objCleS->Stu_Code."' ORDER by Tit_ID ASC,Stu_Code ASC ";
$result = mysqli_query($link, $query);
$row = mysqli_fetch_array($result, MYSQLI_ASSOC);
echo $row["Stu_Name"]." ".$row["Stu_Sername"];
//$objCleS->Stu_Code?></td>
<td>
<input type="text" name="Ssc_Value[<?=$objCleS->Stu_Code?>]" value="<?=$rowCleC["Ssc_Value"]; ?>">
</td>
</tr>
<?
$i++;
}mysqli_free_result($resultCleS); }
mysqli_close($link);
?>
</tbody>
</table>
<!--End Table Striped-->
</fieldset>
<!-- Code Father And Mother -->
<!-- End Code Father And Mother -->
<footer>
<input type="hidden" name="SchD_ID" value="<?=$_REQUEST["SchD_ID"] ?>">
<input type="hidden" name="Ind_ID" value="<?=$_REQUEST["Ind_ID"]?>">
<button type="button" class="btn-u btn-u-default" onclick="window.history.back();">ยกเลิก</button>
<button type="submit" class="btn-u" name="add" id="add">ตกลง</button>
</footer>
</form>
<!-- End Checkout-Form -->
</div>
</div>
<!--=== End Content ===-->
<script language="javascript">
var CheckoutForm = function () {
return {
//Checkout Form
initCheckoutForm: function () {
// Masking
$('#Yeae_ID').mask('9/9999', {placeholder:'X'});
$('#card').mask('9999-9999-9999-9999', {placeholder:'X'});
$('#year').mask('2099', {placeholder:'X'});
// Add validation method
$.validator.addMethod("creditcard", function(value, element, param) {
if( /[^0-9\-]+/.test(value) )
{
return false;
}
},
$.validator.format('Please enter a valid credit card number.'));
// Validation
$('#sky-form').validate({
// Rules for form validation
rules:
{
Ssc_Value[<?=$objCleS->Stu_Code?>]:
{
required: true
},
},
// Messages for form validation
messages:
{
Ssc_Value[<?=$objCleS->Stu_Code?>]:
{
required: 'กรอกข้อมูล'
},
},
// Do not change code below
errorPlacement: function(error, element)
{
error.insertAfter(element.parent());
}
});
}
};
}();
</script>
Tag : PHP, JavaScript
|
ประวัติการแก้ไข 2018-03-10 19:33:15
|
|
|
|
|
Date :
2018-03-10 19:31:34 |
By :
sookurb |
View :
684 |
Reply :
4 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"แต่พอรับข้อมูลที่ Loop ชื่อไม่ส่งค่าครับ" อธิบายขยายความครับ ไม่ส่งยังไง
|
|
|
|
|
Date :
2018-03-12 08:56:57 |
By :
apisitp |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Code (PHP)
<input type="text" name="Ssc_Value[<?=$objCleS->Stu_Code?>]" value="<?=$rowCleC["Ssc_Value"]; ?>">
Code (PHP)
Ssc_Value[<?=$objCleS->Stu_Code?>]:
{
required: true
},
ค่า Ssc_Value[<?=$objCleS->Stu_Code?>]: ใน javascript ไม่มีค่าครับ
|
|
|
|
|
Date :
2018-03-13 21:58:45 |
By :
sookurb |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
ดูที่ Code SQL ทุกๆตัว น่าจะ ผิดตรง WHERE
และ เขียนเต็มหน่อยๆ
Code (PHP)
<?php echo ?>
|
|
|
|
|
Date :
2018-03-14 08:09:06 |
By :
Hararock |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Load balance : Server 02
|