3.0 beta 2

How tabs work in php to load another php page

I am new to javascript but my proble is that I want tabs in my php I try but i did not work.
my code

<style>

#myTabs {width: 55%}

</style>

<span id="myTabs"></span>
<iframe id="myContent" style="border: 1px solid #aaa; height: 450px; width: 80%" frameborder=no></iframe>

<script>

var names = ["Subscribe", "View Subscribers", "Manage Subscribers", "Create Newsletter", "Change Password", "Log Out"];
var values = ["subscibe.php", "viewSubs.php", "manageSubs.php", "createNewsletter.php", "changePass.php", "logOut.php"];

var tabs = new AW.UI.Tabs;
tabs.setId("myTabs");
tabs.setItemText(names);
tabs.setItemValue(values); // store page URLs in the 'value' property.
tabs.setItemCount(6);
tabs.refresh();

</script>

<script>

tabs.onSelectedItemsChanged = function(selected){

var index = selected[0];
var value = this.getItemValue(index);
window.status = index + ": " + value;

document.getElementById("myContent").src = value; // iframe URL
}

tabs.setSelectedItems([0]); // load the first page.

</script>
Sohail
October 28,
Sohail,
Your code, is fine, I just test it with html documents instead of php files and run perfectly, so, check that the php files are at the same level (folder) or maybe other php config?
HTH
Carlos
October 29,
thanks to reply,
one thing i forgot to tell that it loads html but not php file,
all php files are in same folder.
Sohail
October 29,

This topic is archived.

See also:


Back to support forum

Search

Version 2

Looking for AW 2.6 ?
The old site is here.