|
 |
|
จะทำ checkbox ติ๊กก่อนจะสามารถพิมพ์ในช่อง textboxได้ รบกวนหน่อยนะครับควรทำอย่างไงดีครับ |
|
 |
|
|
 |
 |
|
Code (PHP)
<input type="text" name="textbox" disabled="true">
<input type="checkbox" name="checkbox" >
jQuery
Code (JavaScript)
$("input[name='textbox']").click(function(){
var THIS = $(this).is(":checked");
if(THIS !== true){
$("input[name='textbox']").attr("disabled",true);
}else{
$("input[name='textbox']").attr("disabled", false);
}
})
http://jsfiddle.net/K3V7E/1/
|
ประวัติการแก้ไข 2014-05-28 12:58:16 2014-05-28 12:59:40 2014-05-28 13:01:04 2014-05-28 13:01:59
 |
 |
 |
 |
Date :
2014-05-28 12:57:37 |
By :
yamcrocodile |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
ขอบคุณครับ ผมลองแล้วพอติ๊ดแล้ว ไม่สามารถพิมพ์ในช่องtextbox ได้เลยครับ
|
 |
 |
 |
 |
Date :
2014-05-28 13:23:11 |
By :
nonzabboy |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
ผมลองแล้วยังไม่ได้เลยอะครับ ผมจะเอาค่าในช่อง textbox ไปคำนวณ อะครับ
|
 |
 |
 |
 |
Date :
2014-06-01 14:54:02 |
By :
nonzabboy |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
แทรก ตัวนี้ไปหรือยังครับ
<script src="//code.jquery.com/jquery-1.11.0.min.js"></script>
|
 |
 |
 |
 |
Date :
2014-06-02 11:30:05 |
By :
progamer2000 |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
ตอนนี้ผมทำได้แล้วครับ ตอนนี้ติด เช็คค่าว่างใน radio ไม่ได้อะครับ
Code (PHP)
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<style type="text/css">
<!--
body {
background-image: url(images/LWL-1.jpg);
background-attachment : fixed
}
.style1 {color: #FF0000}
-->
</style><head>
<title>ระบบตรวจภาวะความเสี่ยงต่อการเป็นโรคเบาหวาน และ ความดันโลหิตสูง </title>
<link rel="shortcut icon" href="images/smhos.png"/>
<link href="cssimage.css" rel="stylesheet" type="text/css">
<link href="./style.css" rel="stylesheet" type="text/css">
<style type="text/css">
@font-face {
font-family: thsarabunnew-webfont;
src: url("thsarabunnew-webfont.eot") /* EOT file for IE */
}
@font-face {
font-family: thsarabunnew-webfont;
src: url("thsarabunnew-webfont.ttf") /* TTF file for CSS3 browsers */
}
body,input {
font-family: thsarabunnew-webfont;
font-size: 20px;
}
.style2 {color: #000000}
</style>
</head>
<script type="text/javascript">
function fncSubmit(){
if(document.form1.textsex.value == ''){
alert('กรุณาเลือก เพศ');
document.form1.textsex.focus();
return false;
}
if(document.form1.textweight.value == ''){
alert('กรุณากรอก ค่าน้ำหนัก');
document.form1.textweight.focus();
return false;
}
if(document.form1.texthigh.value == ''){
alert('กรุณากรอก ค่าส่วนสูง');
document.form1.texthigh.focus();
return false;
}
if(document.form1.ckk.checked == false && document.form1.ckk1.checked == false ){
alert('Please Click Radio Option ');
return false;
}
document.form1.focus();
}
</script>
<body topmargin="0">
<table width="200" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td><img src="images/หัวๆ.jpg" width="1024" height="250"></td>
</tr>
<tr>
<td background="images/PBLG.jpg"><table width="1025" border="0" cellpadding="0" cellspacing="0">
<tr>
<td width="194" height="83"><a href="index.php"><img src="images/Home_icon.gif" alt="" width="190" height="75" class="imgtransparent"></a></td>
<td width="179"> </td>
<td width="203"> </td>
<td width="125"> </td>
<td width="290"><div align="right"><a href="Contributors.php" target="_blank"><img src="images/producer.gif" alt="" width="190" height="75" class="imgtransparent"></a></div></td>
</tr>
</table>
<p align="left"> </p>
<p align="center"><strong><font size="7">ตรวจภาวะความเสี่ยงโรคเบาหวาน</font></strong></p>
<form name="form1" method="post" action="calculatediabetes.php" onSubmit="JavaScript:return fncSubmit();">
<table width="946" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td width="280" height="55"><div align="right"><strong>เพศ :</strong></div></td>
<td width="666">
<select name="textsex" id="textsex">
<option value="" selected>กรุณาเลือกเพศ</option>
<option value="M">-----ชาย-----</option>
<option value="F">-----หญิง-----</option>
</select> </td>
</tr>
<tr>
<td height="62"><div align="right"><strong>น้ำหนัก :</strong></div></td>
<td><strong>
<input name="textweight" type="text" id="textweight" onKeyUp="value=value.replace(/[^0-9]/g,'')" maxlength="3" placeholder="กรอกเฉพาะตัวเลขเท่านั้น"/>
(กิโลกรัม)</strong></td>
</tr>
<tr>
<td height="68"><div align="right"><strong>ส่วนสูง :</strong></div></td>
<td><strong>
<input type="text" name="texthigh" id="texthigh" onKeyUp="value=value.replace(/[^0-9]/g,'')" maxlength="3" placeholder="กรอกเฉพาะตัวเลขเท่านั้น"/>
(เซนติเมตร)</strong></td>
</tr>
<tr>
<td height="52"><div align="right"><strong>ค่า FBS :</strong></div></td>
<td rowspan="2"><p class="style1"><strong>* กรุณาเลือก </strong><strong>ค่า FBS </strong></p>
<p>
<input name="ckk" type="radio" id="ckk" onclick="if(this.checked){this.form.textFBS.value = ''}; ck_frm();" >
ทราบค่า <strong>FBS</strong>
<input name="ckk" type="radio" id="ckk1" onClick="if(this.checked){this.form.textFBS.value = this.form.ckk.value}else{this.form.textFBS.value = ''} ; ck_frm();" value="2000" >
ไม่ทราบค่า <strong>FBS</strong></p>
<p><div id="frm_txt" style="display:none;">
<input type="text" name="textFBS" id="textFBS" onKeyUp="value=value.replace(/[^0-9]/g,'')" maxlength="3" placeholder="กรอกเฉพาะตัวเลขเท่านั้น" > <strong><span class="style1"><span class="style2">(mg/dl)</span> *ค่าระดับน้ำตาลในเลือดที่เจาะผ่านนิ้วมือ</span></strong></div>
</p></td>
</tr>
<tr>
<td height="98"> </td>
</tr>
<tr>
<td height="31"> </td>
<td><input name="btnSubmit" type="submit" value="Submit" >
<input type="reset" name="button2" id="button2" value="กรอกใหม่"></td>
</tr>
<tr>
<td height="32"> </td>
<td> </td>
</tr>
<tr>
<td colspan="2"></td>
</tr>
</table>
</form>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
</td>
</tr>
<tr>
<td><img src="images/ท้าย.jpg" width="1024" height="100"></td>
</tr>
</table>
</body>
</html>
|
 |
 |
 |
 |
Date :
2014-06-03 08:56:12 |
By :
nonzabboy |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
ขอบคุณมากๆๆเลยครับตอนนี้ทำได้แล้วครับ
|
 |
 |
 |
 |
Date :
2014-06-08 15:58:02 |
By :
nonzabboy |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
|
|
|

|
Load balance : Server 02
|