S
sluijten
What can be suddenly wrong with this java script (it calculates
participants x price = total price)???
function bereken() {
var prijs = 5.0
var totaal = ""
aantal = document.FrontPage_Form1.aantal_lopers.value
tempNumber = aantal * prijs
tempNumber = Math.round(tempNumber * 100)
tempString = "" + tempNumber
totaal = "€ " + tempString.substring(0,(tempString.length-2))
totaal += "," +
tempString.substring((tempString.length-2),tempString.length)
document.FrontPage_Form1.totaal.value = totaal
}
The run time error says:
document.FrontPage_Form1.aantal_lopers.value is null or not an object.
It has always worked!! The form part looks as follows:
<!--webbot bot="Validation" b-value-required="TRUE"
b-disallow-first-item="TRUE" --><select name="aantal_lopers" size="1">
<option value="<pick one>"><kies uit></option>
<option value="1">1</option>
<option value="2">2</option>
<option value="3">3</option>
<option value="4">4</option>
<option value="5">5</option>
<option value="6">6</option>
<option value="7">7</option>
<option value="8">8</option>
</select>
participants x price = total price)???
function bereken() {
var prijs = 5.0
var totaal = ""
aantal = document.FrontPage_Form1.aantal_lopers.value
tempNumber = aantal * prijs
tempNumber = Math.round(tempNumber * 100)
tempString = "" + tempNumber
totaal = "€ " + tempString.substring(0,(tempString.length-2))
totaal += "," +
tempString.substring((tempString.length-2),tempString.length)
document.FrontPage_Form1.totaal.value = totaal
}
The run time error says:
document.FrontPage_Form1.aantal_lopers.value is null or not an object.
It has always worked!! The form part looks as follows:
<!--webbot bot="Validation" b-value-required="TRUE"
b-disallow-first-item="TRUE" --><select name="aantal_lopers" size="1">
<option value="<pick one>"><kies uit></option>
<option value="1">1</option>
<option value="2">2</option>
<option value="3">3</option>
<option value="4">4</option>
<option value="5">5</option>
<option value="6">6</option>
<option value="7">7</option>
<option value="8">8</option>
</select>