Click to See Complete Forum and Search --> : Html Help Asap Please!


JavaDude
05-01-2005, 04:08 PM
I have the follwing Function I use to add radio buttons in a text box
at the bottom of the page:

<script type="text/javascript">
function update(frm, trg) {
var tot=0;
for(var i=0; i<frm.elements.length; i++) {
if(frm.elements[i].type=="radio" && frm.elements[i].checked) tot+=parseInt(frm.elements[i].value);
}
document.getElementById(trg).value=tot-1;
}
</script>

Is there a way to add radio button values using HTML, I am making an eBay
listing and the Javascript isnt working for somereason...I saw an OnClick event somewhere but I cant find it...any help would be awesome thank you.

ray326
05-01-2005, 10:16 PM
The onclick="" would go in each radio button. I think Javascript will figure it out if you just add the value without doing a parseInt() on it.