views:

41

answers:

1

Hi All,

I have two pages name one.php and two.php in one.php i have a combo box which has a option values like

option  value='0'
option  value='1'
option  value='2'
option value ='3'    

Now when on change event of combo box fires i am opening one new window named 'two' as follows

$('#sel').live('change',function(){

var tindex=$(this).val();

//Open a new window and pass tab index 

window.open('two.php#tabs-'+tindex,'two');

});

for the first time new window is opened correctly and ui tab is set accordingly but if i chose another value in combo box lets say '1' then url in a same new window is changed but tab is not set accordingly.

A: 

You can save a reference to the window object returned by open, to get the window object for the popup.

You can then make a function in the popup window that changes the current tab, and call that function from the main window.

For example:

var popup = window.open('two.php#tabs-'+tindex,'two');
popup.setActiveTab(tindex);

In the popup window, you can write

window.setActiveTab = function(newIndex) {
    //Do something
};
SLaks
Excellent !! That works for me !!
hunt