السلام عليكم
بعد مجهود شخصي تمكنت من الحل باذن الله تعالى و توفيق منه
كود HTML:
1<!DOCTYPE html> 2<html> 3<head> 4<meta charset=utf-8 /> 5<title>JS Bin</title> 6<!--[if IE]> 7 <script src="http://html5shiv.googlecode.com/svn/trunk/html5.js"></script> 8<![endif]--> 9<style> 10 article, aside, figure, footer, header, hgroup, 11 menu, nav, section { display: block; } 12</style> 13</head> 14<body> 15 <script type="text/javascript"> 16 function toogle(element){ 17 var c = parseInt(element.value, 10); 18 c = parseInt(element.value, 10); 19 if(element.checked) 20 { 21 c = parseInt(document.getElementById('hel').value, 10) + c; 22 }else{ 23 c = parseInt(document.getElementById('hel').value, 10) - c; 24 } 25 document.getElementById('hel').value = c; 26 } 27 console.log(); 28 </script> 29 <form name="orderForm"> 30 Prix 1:<input name="a" type="checkbox" id="hello" value="12" onclick="toogle(this)"> 12 <br /> 31 Prix 2: <input name="c" type="checkbox" id="hello" value="32" onclick="toogle(this)"/> 32 <br /> 32 Prix 3: <input name="b" type="checkbox" id="hello" value="45" onclick="toogle(this)"/> 45 <br /> 33 Prix 4: <input name="d" type="checkbox" id="hello" value="46" onclick="toogle(this)"/> 46 <br /> 34 <input name="d" type="text" id="hel" value="0" readonly=""/><br /> 35 </form> 36</body> 37</html>
الملف في المرفقات