คำนวณระยะทาง

ปัญหา การเขียน JavaScript เครื่องมือ

Moderator: phpbb, mindphp

ตอบกลับโพส
nunid
phpBBThailand Newbie
phpBBThailand Newbie
โพสต์: 3
ลงทะเบียนเมื่อ: 01 ม.ค. 1970, 07:00

คำนวณระยะทาง

โพสต์ โดย nunid »

คือให้ค่าจากtext1-text2=text3
เมื่อกรอกค่าใน text1 และ text2 แล้วให้ค่าต่างปรากฎที่ text3 อัตโนมัติ
mindphp
phpBBThailand VIP Members
phpBBThailand VIP Members
โพสต์: 2269
ลงทะเบียนเมื่อ: 01 ม.ค. 1970, 07:00
ติดต่อ:

โพสต์ โดย mindphp »

<form name="summing">
a
<input type="text" name="a" size=4 maxlength="4">
+ b
<input type="text" name="b" size="4" maxlength="4">
= c
<input type="text" name="s" size="5" maxlength="5">
<input type="button" value ="Add two" name="Submit" onClick="addit()">
<input type="button" name="Submit2" value="Clear form" onClick="clearform()">
</form>

Javascript
--------------------------
function addit()
{
document.summing.s.value = parseInt(document.summing.a.value) + parseInt(document.summing.b.value)
}

function clearform()
{
document.summing.a.value= " ";
document.summing.b.value= " ";
document.summing.s.value= " ";
}

โปรแกรม คำนวนระยะทางระหว่างจังหวัด
http://www.ecitepage.com/distance.php" onclick="window.open(this.href);return false;
สร้างไฟล์ pdf online
ท่องเที่ยว http://www.thailandhotelforums.com/" onclick="window.open(this.href);return false;
สอน php http://www.mindphp.com/" onclick="window.open(this.href);return false;
ตอบกลับโพส

ย้อนกลับไปยัง

ผู้ใช้งานขณะนี้

กำลังดูบอร์ดนี้: 86 และ บุคคลทั่วไป 0 ท่าน