RE: Using Selectedindex value for calculations
From: Skydolphin (anonymous_at_discussions.microsoft.com)
Date: 04/21/04
- Next message: anonymous_at_discussions.microsoft.com: "Re: Looking for a program to stop people copying text and pics from my sites"
- Previous message: James: "Re: Shockwave problem"
- In reply to: Matthew Ferri: "Using Selectedindex value for calculations"
- Messages sorted by: [ date ] [ thread ]
Date: Wed, 21 Apr 2004 13:06:06 -0700
I prefer javascript to do this but that's my preference. This would work I just tested it. Put the onchange call on the dropdown. onchange="doCalc();"
<script language="javascript">
function doCalc()
{
var firstvalue = document.all("drop1")(document.all("drop1").selectedIndex).text;
var secondvalue = document.all("drop2")(document.all("drop2").selectedIndex).text;
document.all("Text1").value = parseInt(firstvalue) + parseInt(secondvalue);
}
</script><select size="1" name="drop1" onchange="doCalc();"><option value="1">1</option><option value="2">2</option></select><select size="1" name="drop2" onchange="doCalc();"><option value="1">1</option><option value="2">2</option></select><input type="text" name="Text1" value="">
Rhonda
- Next message: anonymous_at_discussions.microsoft.com: "Re: Looking for a program to stop people copying text and pics from my sites"
- Previous message: James: "Re: Shockwave problem"
- In reply to: Matthew Ferri: "Using Selectedindex value for calculations"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|