0

hello all,

i have this code

<script type="text/JavaScript">

function checkbox_click (number)
{
   
 
alert("number is" + number);


    
}
</script>
echo "<input type=\"checkbox\" name=\"boxname\" " value=\"5\" onClick=\"checkbox_click('3');\" /> \n";

i want add more code in javascript
when is check show me in input text the number and when i check mutlti box's is + all number and when i uncheck box is - the number


please help me
thanks

2
Contributors
4
Replies
5
Views
7 Years
Discussion Span
Last Post by rajarajan07
0

i have create this code but not work 100% :(


please can you update it
html

<script  type="text/javascript"> 
 function toogle(element,id){

 var c = id; 
  c = id;

  if(element.checked) 
  { 
  c =  parseInt(document.getElementById('hel').value, 10) + c; 
  }
   else
  { 
  c =  parseInt(document.getElementById('hel').value, 10) - c; 
  }

    document.getElementById('hel').value= c; 
       } 

  </script> 
  
   <form name="orderForm">
   
     Prix 1:<input name="a" type="checkbox" value="1" onclick="toogle(this,'3')">
     <br /> 
      Prix 2: <input name="c" type="checkbox"  id="hello" value="10" onclick="toogle(this,'5')"/>       
      <br />
        <input name="d" type="text" id="hel"  value="0" readonly=""/>
        <br /> 
         </form>
This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.