hello
i searched the archieves and got my script going by using
document.forms[0].field_name.value=‘some text’;
only problem is that when the field names have numbers this fails.
ie:
← input type=“text” name=12 →
document.forms[0].12.value=‘some text’;
document.forms[0].‘12’.value=‘some text’;
does anybody know how to fix this problem.
thanks - rush@idealzone.com
i solved this one a few hours after posting. more so of a javascript problem than anything else.
: i searched the archieves and got my script going by using
: document.forms[0].field_name.value=‘some text’;
: only problem is that when the field names have numbers this fails.
: ie:
: document.forms[0].12.value=‘some text’;
: document.forms[0].‘12’.value=‘some text’;
: does anybody know how to fix this problem.
: thanks - rush@idealzone.com
: hello
: i searched the archieves and got my script going by using
: document.forms[0].field_name.value=‘some text’;
: only problem is that when the field names have numbers this fails.
: ie:
: document.forms[0].12.value=‘some text’;
: document.forms[0].‘12’.value=‘some text’;
: does anybody know how to fix this problem.
: thanks - rush@idealzone.com
It’s also a problem when the field name has a dash in it. One way around this is to use the elements[] array of the form object. So, if the field named ‘12’ is the second element of the form, it would be document.forms[0].elements[1] since the array is zero-based, just like the forms[] array.