469,323 Members | 1,560 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,323 developers. It's quick & easy.

Javascript Problems on Mac's

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(field_name, cur_value){
var obj_form = document.forms[0];
var obj_field = obj_form(field_name);
for(i=0; i<obj_field.length; i++){
if(obj_field.options[i].value == cur_value){
obj_field.options[i].selected = true;
}
}
}

The function is called like this, written by asp:
Response.Write("<script
language=""javascript"">select_option(""mkting_prs n" & i & """, """ &
Session("user_id") & """);</script>")

which ends up being:
<script language="javascript">select_option("mkting_prsn1" ,
"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.value = "878001", this
didn't work either on the mac. Thanks again for any help.
Jul 20 '05 #1
1 3015
da********@raymondjames.com (Big Dave) wrote in message news:<bc**************************@posting.google. com>...
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(field_name, cur_value){
var obj_form = document.forms[0];
var obj_field = obj_form(field_name);
use obj_form[field_name]

for(i=0; i<obj_field.length; i++){
if(obj_field.options[i].value == cur_value){
obj_field.options[i].selected = true;
}
}
}

The function is called like this, written by asp:
Response.Write("<script
language=""javascript"">select_option(""mkting_prs n" & i & """, """ &
Session("user_id") & """);</script>")

which ends up being:
<script language="javascript">select_option("mkting_prsn1" ,
"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.value = "878001", this
didn't work either on the mac. Thanks again for any help.

Jul 20 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.

By using this site, you agree to our Privacy Policy and Terms of Use.