SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Guru
    Join Date
    Dec 2008
    Posts
    692
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    'clientActiveTabChanged' is undefined

    i have a tab conatiner with 5 tabs

    i need to get the active tab index

    so i have a javascript to get teh active tabindex but i get error

    below is the runtime code viewd in browser




    Sys.Application.add_init(function() {
    $create(AjaxControlToolkit.TabContainer, {"activeTabIndex":0,"autoPostBackId":"ctl00$ContentMain$Tabs","clientStateField":$get("ctl00_ContentMain_Tabs_ClientState")}, {"activeTabChanged":clientActiveTabChanged}, null, $get("ctl00_ContentMain_Tabs"));

    });




    function clientActiveTabChanged(sender, args)
    {
    document.getElementById('<%=Htabindex.ClientID%>').value=sender.get_activeTabIndex();

    }

  2. #2
    om nom nom nom Stomme poes's Avatar
    Join Date
    Aug 2007
    Location
    Netherlands
    Posts
    10,272
    Mentioned
    50 Post(s)
    Tagged
    2 Thread(s)
    The code you posted isn't enough for anyone to debug it, since it's clearly relying on ColdFusion? or something on the back making HTML, and then obviously some library or hand-made tools...

    But you may want to look here
    "clientStateField":$get("ctl00_ContentMain_Tabs_ClientState"

    Here you'r getting a value of the state of your tabs, so you might want to check that clientStateField isn't null, but actually gets something. I assume the program has to get the states before picking out the one who's active first. "activeTabChanged" is being assigned the function below... does that function actually get useful stuff for the sender and args parameters?

    If this code were plopped in my lap, that would be where I would start, not knowing anything else. You are using a debugger in your browser?


Bookmarks

Posting Permissions

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