Guest_imported
New member
- Jan 1, 1970
- 0
How to get values of for instance a checkbox with 3 checkboxes, how to make the function that decidedes if they are checked or not? Is it it possible to do this:
var lunsj=document.bestilling.lunsj.checked
function _lunsj(form) {
if (document.bestilling.lunsj.checked)
lunsj=parseInt(document.bestilling.lunsj.value);
else
lunsj=0
And the same with select-boxes, can u do like this:
var rompris=document.bestilling.rom.value
function _rompris(form)
{
if (form.Rom.options[0].selected)
rompris=300
else if (form.Rom.options[1].selected)
rompris=320
else if (form.Rom.options[2].selected)
rompris=400
else (form.Rom.options[3].selected)
rompris=700
}
And if this is possible; how do yo do the summary in the end?
thanX
var lunsj=document.bestilling.lunsj.checked
function _lunsj(form) {
if (document.bestilling.lunsj.checked)
lunsj=parseInt(document.bestilling.lunsj.value);
else
lunsj=0
And the same with select-boxes, can u do like this:
var rompris=document.bestilling.rom.value
function _rompris(form)
{
if (form.Rom.options[0].selected)
rompris=300
else if (form.Rom.options[1].selected)
rompris=320
else if (form.Rom.options[2].selected)
rompris=400
else (form.Rom.options[3].selected)
rompris=700
}
And if this is possible; how do yo do the summary in the end?
thanX