i dont post much here, but i was hoping someone might be able to answer my question. i have a picture with an onmouseover event that assigns a value to a field, now the field is dependant on another field eg:
field 1 (name = Q1help) (value = “”)
field 2 (name = $table1) (value = 1)
i would like my code to set the value of Qxhelp where x is the value of $table1
something like this, but this dosent work!
document.forms[0].“Q”+$table1+“help”.value+“help”
PLEASE HELP, i dont know how to search for an answer on this, many thanks!
Subject: javascript set field
put $table1 into a var ievar fldtable1 = document.forms[0].$table1.value
then put your line in using this value
document.getElementById(“Q”+fldtable1+“help”).value = “what ever you want to set it to”
Subject: RE: javascript set field
thank you so much for your fast response, you are a legend! you saved me a lot of time and poor code ‘hardcoding’ field names!
i should have mentioned that i’m using the notes client and not web so a quick change to the code and im flying!
in the end i used:
var section = document.forms[0].$table1.value;
document.forms[0].elements[“Q”+section+“help”].value = “skjdhfk”;
thanks again!