Hey All,
Trying to run the following in a php foreach loop where $key= form_field_name, and $value = the posted field value, hoping that I can SET the corrisponding options as SELECTED based on the value posted, and then SET remaining text or NON SELECT fields to their posted values in subsequent itterations.
[code=php]
foreach ($arr as $key => $value) {
echo “<script>
// form_name = search_recds field_name = $key
field=document.search_recds.$key;
if(field.tagName==’SELECT’){
document.search_recds.$key.options[‘$value’].selected=true;
//alert(field);
}
else{document.search_recds.$key.value=’$value’;}
</script>”;
No problem setting the text fields, but can select options only be accessed/set by their numeric array positions?