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 4 of 4
  1. #1
    New to the CF scene
    Join Date
    May 2010
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Internet Explorer GetElementByID.innerHTML in IE and FF

    Hi,

    I have code in jsp like this

    <div id="ruleActionOptions" style="visiblity:hidden;display:none;">
    <option value="A" selected>Approve</option>
    <option value="L">Final Approver</option>
    <option value="Z">Bypass</option>
    </div>

    this code document.getElementById("ruleActionOptions").innerHTML;

    In IE :

    give me

    <option value="A" selected>Approve</option>
    <option value="L">Final Approver</option>
    <option value="Z">Bypass</option>

    In FireFox:

    It gives

    Approve
    Final Approver
    Bypass

    I want same result In firefox.

    can anybody please suggest some thing?

    Thanks in Advance
    With Regards
    Last edited by sm3128; 05-06-2010 at 08:51 AM.

  • #2
    Supreme Master coder! abduraooft's Avatar
    Join Date
    Mar 2007
    Location
    N/A
    Posts
    14,865
    Thanks
    160
    Thanked 2,224 Times in 2,211 Posts
    can anybody please suggest some thing?
    Yes. Your markup is invalid, so validate and fix the errors firts before doing any DOM operations using javascript.
    Last edited by abduraooft; 05-07-2010 at 02:35 PM.
    The Dream is not what you see in sleep; Dream is the thing which doesn't let you sleep. --(Dr. APJ. Abdul Kalam)

  • #3
    New Coder
    Join Date
    May 2010
    Posts
    20
    Thanks
    0
    Thanked 1 Time in 1 Post
    Try this-

    <div id="ruleActionOptions" style="visiblity:hidden;display:none;">
    <select>
    <option value="A" selected>Approve</option>
    <option value="L">Final Approver</option>
    <option value="Z">Bypass</option>
    </select>
    </div>

  • #4
    Kor
    Kor is offline
    Red Devil Mod Kor's Avatar
    Join Date
    Apr 2003
    Location
    Bucharest, ROMANIA
    Posts
    8,478
    Thanks
    58
    Thanked 379 Times in 375 Posts
    I don't think it is HTML legal to nest some options within DIV elements. You could, alternatively, to nest some options within <optgroup></optgroup>
    KOR
    Offshore programming
    -*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*


  •  

    Posting Permissions

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