Changin controls properties with javascript

Last post 05-18-2008 4:02 PM by cattinmarc. 2 replies.

Sort Posts:

  • Changin controls properties with javascript

    05-18-2008, 7:10 AM
    • Member
      15 point Member
    • cattinmarc
    • Member since 05-12-2008, 6:30 AM
    • Posts 11

    Hey guys i'm no wizzard with javascript lol

    Someone has helped me with something before and i tried using a similar code but instead of buttons i'm using listboxes

    this is the code i'm using to highlight the menu option and to make the listbox related to the option appear in the page (while the other listboxes if there's any visible disappear)

    the images work fine but the listboxes don't appear and disapear...

    function homefunction()

    {

    //declaring image variables

    var home = document.getElementById("imgHome");

    var product = document.getElementById("imgProduct");

    var shopcart = document.getElementById("imgShoppingCart");

    var faq = document.getElementById("imgFaq");

    var contact = document.getElementById("imgContact");

     

    //declaring tree view variables

    var mnuhome = document.getElementById("lbxHome");

    var mnuproduct = document.getElementById("lbxProduct");

    var mnushopcart = document.getElementById("lbxShopCart");

    var mnufaq = document.getElementById("lbxFaq");

    var mnucontact = document.getElementById("lbxContact");

     

    //menu effect

    home.src="../images/Home1.jpg";

    product.src="../images/Product.jpg";

    shopcart.src="../images/ShoppingCart.jpg";

    faq.src="../images/FAQ.jpg";

    contact.src="../images/ContactUs.jpg";

     

    //tree view appear and disappear code

     

    mnuhome.style.visibility=
    "visible";

    mnuproduct.style.visibility="hidden";

    mnushopcart.style.visibility="hidden";

    mnufaq.style.visibility="hidden";

    tvwcontact.style.visibility="hidden";

    }

  • Re: Changin controls properties with javascript

    05-18-2008, 8:58 AM
    • All-Star
      20,694 point All-Star
    • A1ien51
    • Member since 05-06-2005, 6:46 PM
    • MD USA
    • Posts 3,808
    If the select elements are serverside elements or have runat=server on it, you need to use the ClientId. Plenty examples on using ClientId on thew forum.
    Eric
  • Re: Changin controls properties with javascript

    05-18-2008, 4:02 PM
    • Member
      15 point Member
    • cattinmarc
    • Member since 05-12-2008, 6:30 AM
    • Posts 11

    hey this code worked before with buttons Sad

Page 1 of 1 (3 items)