R
Randell D.
Folks,
I have a form called "ourTestForm".
Its a test form - nothing special - it contains five input tags - they
are named one, two, three, four and five.
The input tags are of type text,text,radio,checkbox and select.
When I run the following code, it correctly reports "text" (for input
tag named "one") but it reports (alerts) input tag four as being
"undefined". The same happens for any input tag that is not of type "text".
How come? How can I fix it?
<script language="JavaScript" type="text/javascript">
function complete_field(form_name,field_name,field_value)
{
var form_name_obj=document.forms[form_name];
var field_type=form_name_obj.elements[field_name].type;
alert(field_type);
return true;
}
complete_field("ourTestForm","one","whatever");
complete_field("ourTestForm","four","whatever");
</script>
All help via the newsgroup please, so all can learn... thanks,
randelld
I have a form called "ourTestForm".
Its a test form - nothing special - it contains five input tags - they
are named one, two, three, four and five.
The input tags are of type text,text,radio,checkbox and select.
When I run the following code, it correctly reports "text" (for input
tag named "one") but it reports (alerts) input tag four as being
"undefined". The same happens for any input tag that is not of type "text".
How come? How can I fix it?
<script language="JavaScript" type="text/javascript">
function complete_field(form_name,field_name,field_value)
{
var form_name_obj=document.forms[form_name];
var field_type=form_name_obj.elements[field_name].type;
alert(field_type);
return true;
}
complete_field("ourTestForm","one","whatever");
complete_field("ourTestForm","four","whatever");
</script>
All help via the newsgroup please, so all can learn... thanks,
randelld