...

View Full Version : failing form elements



mr_ego
10-22-2003, 12:07 AM
This always fails on IE (and opera)... any ideas?
However, it works on Mozilla and NS.



i=0;
document.forms["userdefform"].elements["currency"].options[i] =
new Option("United States Dollars", "usa");
++i;
document.forms["userdefform"].elements["currency"].options[i] =
new Option("Euro", "euro");
++i;
document.forms["userdefform"].elements["currency"].options[i] =
new Option("Canadan Dollars", "canada");
++i;
document.forms["userdefform"].elements["currency"].options[i] =
new Option("United Kingdom Pounds", "uk");


my form says (something similar to):



<form name="userdefform">
<select name="currency">
</select>
</form>


... Keep in mind i am using Mandrake.

Roelf
10-22-2003, 06:19 AM
then i guess it is the combination of mandrake/ie, because your code works great in winxp/ie

and why a new thread and not continue the other one about this same subject?

glenngv
10-22-2003, 06:44 AM
Yes, you should have continued this thread (http://www.codingforums.com/showthread.php?s=&threadid=27879).

mr_ego
10-22-2003, 07:45 AM
I'm testing IE on windows. As if WINE could run IE on mandrake!

glenngv
10-22-2003, 08:11 AM
is there any error message thrown?

mr_ego
10-22-2003, 08:31 AM
none.


if you wanna preview what im doing:
www.netfuse.com.au/hotel.php

glenngv
10-22-2003, 08:41 AM
Could be a MIME-type problem. Try setting the ContentType to "text/javascript" in the currency.php. Put also an alert inside the init_currency() function to verify that it is being called.

beetle
10-22-2003, 09:02 AM
I find the Option constructor to be buggy -- try document.createElement instead.

mr_ego
10-22-2003, 09:03 AM
After finding the cause of 3 days of worry, I would like to emphasise the use of the </script> tag in all your javascript code...


GOD IM AN IDIOT!


Mozilla and NS dont care.
However IE, Konqueror and Opera chuck the sh**s!

-Bash

[Note to moderators: im trying not to swear. be nice]

beetle
10-22-2003, 09:05 AM
Hehe, ya. Those can help, can't they? :p



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum