Sorry - braindead & need a JavaScript Guru

I have:for (var i=0;i<a1.length;i++) {

ccheck = ‘isarray’;

if (a1[i].checked){

document.forms[0].Score_1.value=document.forms[0].Sc_1[i].value;

etc

The idea being to pick up one of the values in field SC_1 on the form. Now wherever I have looked whilst trying to get this work it says that this should be ok. However the Javascript is failing at that point. (Mucho use of ALERT to pin it down.)

Lots of pratting around later I can tell that in fact its the document.forms[0].Sc_1[i].value that is not working.

If I remove the .value (yes I know we need it but you get so desperate you’ll try anything) then I get ‘undefined’ when I display the result.

Any bright ideas out there? (Am debugging someone elses code & the odd comment would not have gone amiss!)

Subject: Sorry - braindead & need a JavaScript Guru

What type of field is which???

.value works only on single values fields.

Sc_1 is a normal text field?

Subject: RE: Sorry - braindead & need a JavaScript Guru

Sc_1 is a radio button.Score_1 is a text field.

Background: the app is an online survey. So the user ticks a radio button & behind the scenes the script is supposed to translate ‘AGree’ to a numeric value. Sc_1 is the list of numeric values .

Thanks

Subject: Bright Idea on the way home last night

Unfortunately can’t try it today as am at a customer site.

The plan:

  • keep the JavaScript to do the validation - thats working a treat.

  • have a WebQuerySave agent to do the field setting. Then I can use LotusScript and have a decent debugger!

I reckon this should work, but the proof will be in the pudding tomorrow.