Good morning. Any help anyone could provide would be much
appreciated. I'm pulling values from a database and I need to select
a matching option in a select box. I've got a function to do this,
and it works fine on a pc, but not on a mac IE5. I can't find any
information about why this wouldn't work. Here's the code:
//Select matching option in a select box;
function select_option(f ield_name, cur_value){
var obj_form = document.forms[0];
var obj_field = obj_form(field_ name);
for(i=0; i<obj_field.len gth; i++){
if(obj_field.op tions[i].value == cur_value){
obj_field.optio ns[i].selected = true;
}
}
}
The function is called like this, written by asp:
Response.Write( "<script
language=""java script"">select _option(""mktin g_prsn" & i & """, """ &
Session("user_i d") & """);</script>")
which ends up being:
<script language="javas cript">select_o ption("mkting_p rsn1",
"878001");</script>
Any thoughts on why this wouldn't work on a mac? Oh, and I've also
already tried document.forms[0].mkting_prsn1.v alue = "878001", this
didn't work either on the mac. Thanks again for any help.
appreciated. I'm pulling values from a database and I need to select
a matching option in a select box. I've got a function to do this,
and it works fine on a pc, but not on a mac IE5. I can't find any
information about why this wouldn't work. Here's the code:
//Select matching option in a select box;
function select_option(f ield_name, cur_value){
var obj_form = document.forms[0];
var obj_field = obj_form(field_ name);
for(i=0; i<obj_field.len gth; i++){
if(obj_field.op tions[i].value == cur_value){
obj_field.optio ns[i].selected = true;
}
}
}
The function is called like this, written by asp:
Response.Write( "<script
language=""java script"">select _option(""mktin g_prsn" & i & """, """ &
Session("user_i d") & """);</script>")
which ends up being:
<script language="javas cript">select_o ption("mkting_p rsn1",
"878001");</script>
Any thoughts on why this wouldn't work on a mac? Oh, and I've also
already tried document.forms[0].mkting_prsn1.v alue = "878001", this
didn't work either on the mac. Thanks again for any help.
Comment