Need help to java script passing value

Can any of you help me to find the soluation please . I have a problem to passing value from java script to php… here is my code …

/**************** PART 1***************************/

<input type=‘submit’ onClick=‘MyPopup($tt)’ value=’ Details '>

This is my part 1 where I am calling a javascript function and passing a value. I want This value on my PART 3

/*************** PART2******************/

<script type=“text/javascript” language=“javascript”>

/****this function is for popup my <div> *****/

function MyPopup(tt) {
setOpacity( 0 );
document.getElementById(“styled_popup”).style.display = “block”;
fadeInMyPopup();
}

/***** this function is for fade my popup window ********/
function fadeInMyPopup() {
for( var i = 0 ; i <= 100 ; i++ )
setTimeout( ‘setOpacity(’ + (i / 10) + ‘)’ , 8 * i );
}
</script>

/*************** PART 3*******************/
Abc.php

<div id=‘styled_popup’ name=‘styled_popup’ style=‘width:600px; display:none; position: absolute; top: 150px; left: 50px; zoom: 1’>

////////////////////////Want my value here///////////////////////////

</div>

Why can you not make use of that $tt value in the third part?

hi, thanks for your replay… ya thats i want to do , how i can use that on third part…

How is Abc.php related to the previous lot?

Is Abc.php being included? Is a form submitssion taking the person to Abc.php? Is Abc.php accessed by clicking a link? Or is something else happening there.

hi
basically, all parts are in abc.php

/**************** PART 1***************************/

for ($tt=0;$tt<=10; $tt++)
{
<input type=‘submit’ onClick=‘MyPopup($tt)’ value=’ Details '>
}
[COLOR=“DarkRed”]
here on onclick elements is calling MyPopup function…

this function is popping up the part 3 <div>…

and I need that $tt value into the <div>[/COLOR]

/*************** PART2******************/

<script type=“text/javascript” language=“javascript”>

/****this function is for popup my <div> *****/

function MyPopup(tt) {
setOpacity( 0 );
document.getElementById(“styled_popup”).style.display = “block”;
fadeInMyPopup();
}

/***** this function is for fade my popup window ********/
function fadeInMyPopup() {
for( var i = 0 ; i <= 100 ; i++ )
setTimeout( ‘setOpacity(’ + (i / 10) + ‘)’ , 8 * i );
}
</script>

/*************** PART 3*******************/
Abc.php

<div id=‘styled_popup’ name=‘styled_popup’ style=‘width:600px; display:none; position: absolute; top: 150px; left: 50px; zoom: 1’>

////////////////////////Want my value here///////////////////////////

If the $tt variable is declared in PHP in part 1, it should automatically be available at all other parts of the PHP code after that.

but its not constant… $tt is changing by for loop

Let’s get some more details about what you want then.

Well in that case, you can have the javascript replace the contents of the styled_popup div.

From within the function with the tt variable:


var text = document.createTextNode(tt),
    div = document.getElementById('styled_popup');

while (div.hasChildNodes()) {
    div.removeChild(div.firstChild);
}

div.appendChild(text);

<?

$tt=0;
for ($row = 0; $row < 10; $row++)
{

$i=($row&1) ? "1" : "0"; ///CHECK No ODD OR EVEn
if($i=="1") { $color="#EDF7CA"; }
else if($i=="0") { $color="#EEF8B8"; }
echo "&lt;tr class='employ' bgcolor='".$color."'&gt;";
$reed=keydatas_reed($keydata,$location);
for ($col = 0; $col &lt; 4; $col++)
{
	if($col!=3){	echo "&lt;td class='employ'&gt;".$reed[$col][$row]."&lt;/td&gt;"; }
	else if($col==3)
		{	
[COLOR="DarkRed"]echo "&lt;td class='employ'&gt;".$tt."&lt;input type='submit' id='tt' name='tt' onClick='fireMyPopup($tt)' value=' Details '&gt;&lt;/td&gt;";[/COLOR]

			}
}

$tt=$tt+1;
echo “</tr>”;
}
?>

Part 3

<div id=‘styled_popup’ name=‘styled_popup’ style=‘width:600px; display:none; position: absolute; top: 150px; left: 50px; zoom: 1’>
<? /* I want to display here different value on different time… depending on $tt value */?>
</div>

Sorry ! but i dont get you properly…

what should i need to replace…

As an example of usage, you could put it in a separate function and call it from the MyPopup function.

Its not working…

Just want to let you know… I can have $tt value on MyPopup function()…

What I need … Just send data from MyPopup function() to my Div element…

Show us what you’re doing (a live web page is very useful) and we’ll show you what you’re doing wrong how to get it working.

Free Job Post, All uk Job sites here, more choice at uwantvgot

go there… write something on Enter keyword … u can leave location field…

select REED … the search …

once u got the result… u can see details … click on that thats what i want…

once some one click on details it should be show the details…

There are currently some other scripting problems on the results page too.
In Internet Explorer’s Internet Options page, go to the Advanced tab and turn on “Display a notification about every script error”

That will help you to find major problems, so that you can then fix them.

With many other web browsers, you can use Ctrl-Shift-J to show errors.

Can you please have a look now and let me know how to do that ?

Here’s how you do it.

In Internet Explorer’s Internet Options page, go to the Advanced tab and turn on “Display a notification about every script error”

hi

Sorry But I am not talking about the error display… There is no more error …

I am talking about… how can i pass value when i click on that Details Button …

you can put the sample code provided earlier in to separate function and call it from the fireMyPopup function