Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

problem with update

Status
Not open for further replies.

jepe666

Programmer
Apr 17, 2008
36
ID
I have problem with update..
I have lay out form like this :
checkbox custname percentage
1 custA 20
2 custB 20
3 custC 20
4 custD 20
5 custE 20
i want to update percentage,in textbox percentage..
how the code for this..thanks..
 
I need more information. You want to update a percentage, from what? You didn't give much info and it looks like this would probably be a Javascript result anyway.
 
I took a stab at a possible solution, copy this into whatever editor you using to see what is going on, then tweak as you need.

Code:
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<title>New Page 1</title>
<script language="javascript">
function displ()
{
  Tot = ""
  A1= document.form1.A1.options[document.form1.A1.selectedIndex].value;
  B1= document.form1.B1.options[document.form1.B1.selectedIndex].value;

  Tot = parseInt(A1) + parseInt(B1)   
  document.form1.textfield.value = Tot 
}
//-->
</script>
</head>

<body>
 <form action="" method="post" name="form1">
		<select size="1" name="A1" onClick="return displ();">
                        <option value="0">0%</option>
                        <option value="5">5%</option>
                        <option value="10">10%</option>
                        <option value="15">15%</option>
                        <option value="20">20%</option>
                        <option value="25">25%</option>
                        <option value="30">30%</option>
                        <option value="35">35%</option>
                        <option value="40">40%</option>
                        <option value="45">45%</option>
                        <option value="50">50%</option>
                        <option value="55">55%</option>
                        <option value="60">60%</option>
                        <option value="65">65%</option>
                        <option value="70">70%</option>
                        <option value="75">75%</option>
                        <option value="80">80%</option>
                        <option value="85">85%</option>
                        <option value="90">90%</option>
                        <option value="95">95%</option>
                        <option value="100">100%</option>
                        </select>
                        
		<select size="1" name="B1" onClick="return displ();">
                        <option value="0">0%</option>
                        <option value="5">5%</option>
                        <option value="10">10%</option>
                        <option value="15">15%</option>
                        <option value="20">20%</option>
                        <option value="25">25%</option>
                        <option value="30">30%</option>
                        <option value="35">35%</option>
                        <option value="40">40%</option>
                        <option value="45">45%</option>
                        <option value="50">50%</option>
                        <option value="55">55%</option>
                        <option value="60">60%</option>
                        <option value="65">65%</option>
                        <option value="70">70%</option>
                        <option value="75">75%</option>
                        <option value="80">80%</option>
                        <option value="85">85%</option>
                        <option value="90">90%</option>
                        <option value="95">95%</option>
                        <option value="100">100%</option>
                        </select>
                        
<input type="text" name="textfield" size="5" onFocus="this.blur()"> 
</form>                       
</body>
</html>
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top