...

View Full Version : <Option> Problem in IE but not FF/Chrome. Javascript?



hrl2k
07-29-2010, 08:33 PM
Hi again all, back with another hopefully easy question to fix.

Please check this out in Internet explorer:

http://www.lindesigns.us/rma/rmaonline.html

I googled for the answer, but could not come up with a good response in terms of my own script on how to make the return code fields EXPAND to full length when pressed like they do in firefox and chrome.

Does anyone have a quick fix for this? It's all dynamically loaded except for the first 10 fields (Which i might as well take out anyway), so I'm thinking I have to put something in the javascript somewhere, just no idea what. Thanks a lot!

-pcitech

tomws
07-29-2010, 09:23 PM
Not javascript. Maybe this?

<select name="reason[]" id="field-43ba93784be0f44" style="width: 60px;">

By the way, you do have a javascript error on the page:

table is null
http://www.lindesigns.us/rma/rmaonline.html
Line 111

Most likely it stems from this in the body tag:

onload="addInput();"
The addInput function expects an argument to be passed.


Looking a bit more, many of your tags seem to be screwed up. For instance, why is your closing head tag inside the body tag section? Why is your form inside an h1 tag? Did you build this in Dreamweaver/Frontpage or something like that? It certainly isn't xhtml strict as the doctype specifies. You should probably get that taken care of before debugging other issues.

Old Pedant
07-29-2010, 09:29 PM
How about this?


<html>
<body>
<form>
<select style="width: 80px;" name="whatsit" size="1"
onclick="this.style.width='200px';this.size=this.size==1?(this.options.length>10?10:this.options.length):1;"
onblur="this.style.width='80px';this.size=1;">
<option></option>
<option>This is a pretty long option</option>
<option>And this one is just as long</option>
</select>
</form>
</body>
</html>

hrl2k
07-29-2010, 10:41 PM
Not javascript. Maybe this?

<select name="reason[]" id="field-43ba93784be0f44" style="width: 60px;">

By the way, you do have a javascript error on the page:


Most likely it stems from this in the body tag:

onload="addInput();"
The addInput function expects an argument to be passed.


Looking a bit more, many of your tags seem to be screwed up. For instance, why is your closing head tag inside the body tag section? Why is your form inside an h1 tag? Did you build this in Dreamweaver/Frontpage or something like that? It certainly isn't xhtml strict as the doctype specifies. You should probably get that taken care of before debugging other issues.

thanks a lot, will fix things up. Im a graphic designer who is right now doing a programming job (not by choice :)) and i know the code isnt too great at all. And yeah im using Dreamweaver. Does it often do things that shouldnt be done like that? I've rarely had problems in the past.



How about this?


<html>
<body>
<form>
<select style="width: 80px;" name="whatsit" size="1"
onclick="this.style.width='200px';this.size=this.size==1?(this.options.length>10?10:this.options.length):1;"
onblur="this.style.width='80px';this.size=1;">
<option></option>
<option>This is a pretty long option</option>
<option>And this one is just as long</option>
</select>
</form>
</body>
</html>


thanks a lot, that worked out it seems. Damn IE for all this hassle. I really appreciate it.



Thx to all, will work on fixing it up.

tomws
07-29-2010, 10:49 PM
And yeah im using Dreamweaver. Does it often do things that shouldnt be done like that? I've rarely had problems in the past.


WYSIWYG editors can do that, yes. I don't know about the newer generations, but I'd bet they're the same as the last one I used several years ago.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum