...

View Full Version : Simple javascript not working in IE!!



don_black
01-24-2006, 04:35 PM
Hi,

im just trying a simple bit javascript, it works in Firefox, but not IE!

heres the code :

-------------------------

<script language="JavaScript" type='text/javascript'>

function selector() {

if (document.form.style.value =='Victorian' && document.form.model.value =='DwarfWall')
(document.form.table.value = 'table1')

}

</script>

-------------------------

and the HTML:

-------------------------
<form name="form" method="post" action="">
<select name="style">
<option selected>Select a Style...</option>
<option>Victorian</option>
</select>
<select name="model" onChange="javascript:selector()" >
<option selected>Choose a Model</option>
<option>DwarfWall</option>
</select>
<input name="table" type="text">
</form>
-------------------------

Iv been tearing my hair out for ages over this, searched the web and i still cant fix it! i need it to work in IE aswell....

thanks

don

doomchan
01-24-2006, 04:43 PM
<option value ="Victorian">Victorian</option>

and

<option value ="DwarfWall">DwarfWall</option>

Bill Posters
01-24-2006, 04:44 PM
It's likely that style is a reserved word (used by the DOM), so you shouldn't use it as an id, name or class.

don_black
01-24-2006, 04:50 PM
:mad: i knew it would be something dead simple..... thats just a lil bit out of a 800 line script..... and firefox was loving it but IE wasnt

thanks very much for the fast responses :thumbsup:



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum