Hello Gurus,

i have several forms on a page that get generated dynamicly form a database.
Checking the fields etc requires an id for each form ..

i have a problem with this code here. .

elid is the id of the form .. the elid gets passed from the form itself .. it is
a 5 digit number. My question is .. does that work this way ?

I am fairly new to Java script and help would be appreciated.

function Setradio(elid)

    var oucombinedscore =0;

    oucombinedscore=parseFloat(document.elid.pickscorehome.value) + parseFloat(document.elid.pickscorevisitor.value);

    etc etc .. 


It's much easier to pass (a reference to) the form itself rather than its id.

For example:

<form ..... onsubmit="function Setradio(this);">
<input type="button" ..... onclick="Setradio(this.form)">
function Setradio(f){
    var oucombinedscore = 0;
    oucombinedscore=parseFloat(f.pickscorehome.value) + parseFloat(f.pickscorevisitor.value);
    //etc etc ..