Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 5 of 5
  1. #1
    New to the CF scene
    Join Date
    Jul 2010
    Posts
    7
    Thanks
    3
    Thanked 0 Times in 0 Posts

    <Option> Problem in IE but not FF/Chrome. Javascript?

    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

  • #2
    Senior Coder tomws's Avatar
    Join Date
    Nov 2007
    Location
    Arkansas
    Posts
    2,644
    Thanks
    29
    Thanked 330 Times in 326 Posts
    Not javascript. Maybe this?
    Code:
    <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:
    Code:
    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.
    Are you a Help Vampire?

  • Users who have thanked tomws for this post:

    hrl2k (07-29-2010)

  • #3
    Supreme Master coder! Old Pedant's Avatar
    Join Date
    Feb 2009
    Posts
    27,191
    Thanks
    80
    Thanked 4,562 Times in 4,526 Posts
    How about this?
    Code:
    <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>
    An optimist sees the glass as half full.
    A pessimist sees the glass as half empty.
    A realist drinks it no matter how much there is.

  • Users who have thanked Old Pedant for this post:

    hrl2k (07-29-2010)

  • #4
    New to the CF scene
    Join Date
    Jul 2010
    Posts
    7
    Thanks
    3
    Thanked 0 Times in 0 Posts
    Quote Originally Posted by tomws View Post
    Not javascript. Maybe this?
    Code:
    <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:
    Code:
    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.


    Quote Originally Posted by Old Pedant View Post
    How about this?
    Code:
    <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.

  • #5
    Senior Coder tomws's Avatar
    Join Date
    Nov 2007
    Location
    Arkansas
    Posts
    2,644
    Thanks
    29
    Thanked 330 Times in 326 Posts
    Quote Originally Posted by hrl2k View Post
    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.
    Are you a Help Vampire?


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •