Re: Real-time form-field updating
- From: "webmaster@xxxxxxxxxxxx" <webmaster@xxxxxxxxxxxx>
- Date: 21 Nov 2005 10:24:50 -0800
This is code from "http://www.mcfedries.com/JavaScript/AddItUp.asp"
that looks like it does what I am looking for, but it is based off of
drop down menus and I am using text boxes for my entry source. Can
anyone tell me how I need to edit this so that it will work for text
boxes?
<SCRIPT LANGUAGE="JavaScript">
<!--
function AddItUp(form) {
var item, firstValue, secondValue, thirdValue;
// Get the value of the item that's selected in the first list
item = form.first.selectedIndex;
firstValue = eval(form.first.options[item].value)
// Get the value of the item that's selected in the second list
item = form.second.selectedIndex;
secondValue = eval(form.second.options[item].value)
// Get the value of the item that's selected in the third list
item = form.third.selectedIndex;
thirdValue = eval(form.third.options[item].value)
// Add up the value and display the total
form.total.value = firstValue + secondValue + thirdValue
}
//-->
</SCRIPT>
.
- Follow-Ups:
- Re: Real-time form-field updating
- From: Thomas 'PointedEars' Lahn
- Re: Real-time form-field updating
- References:
- Re: Real-time form-field updating
- From: Thomas 'PointedEars' Lahn
- Re: Real-time form-field updating
- Prev by Date: Can you use a [XMLHTTPSRequest] callback function in a Bookmarklet?
- Next by Date: Re: AJAX without XML
- Previous by thread: Re: Real-time form-field updating
- Next by thread: Re: Real-time form-field updating
- Index(es):
Relevant Pages
|