Dear All,
I am using third part tab. So I have build the tabs nicely and include the code like below. The problem now is that when one of the tab is press it call the javascript. So that is when I dont know how to pass the $dD or $dK value to be set true. If pure php I know how to do it but I dont know how to pass the value via the javascript. I have tried putting <?php ?> in the javascript but no sucess too. Any help please.

<?php
require "KoolTabs/kooltabs.php";


echo"dD".$dD;
echo "dK".$dK;
//Step 2: Create kooltabs object.
$kts2 = new KoolTabs("kts");

//Step 3: Set properties for kooltabs
$kts2->styleFolder = "KoolTabs/styles/silver";

//Step 4: Add tabs for KoolTabs: addTab($parentid,$id,$text,$link)
$kts2->addTab("root","dD","dD","javascript:showTab(\"dD\")",$dD);
$kts2->addTab("root","dK","dK","javascript:showTab(\"dK\")",$dK);
?>

It's kinda hard to tell how the tab script works, is it a PHP script that generates the HTML and Javascript or is it just a javascript script that you need to pass the value to?

Member Avatar for diafol

Use [ CODE ] tags

only who wrote that class you are using has the how to. If you don't want to read this class (and what is doing) write your own to avoid mixed logic.

have you try document.getElementbyId()?
you can pass javascript to php by passing value to another element
e.g

var content = 'abc';
document.getElementById('a').value = content ;

<input type="text" name="a" id="a">

<?php echo $_POST['a']; ?>
Member Avatar for diafol

This looks a little awkward. jQuery UI tabs seem a lot easier to use.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.