469,282 Members | 1,923 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,282 developers. It's quick & easy.

passing php variables with javascript?

I am trying to open a small new window using javascript and pass a php
variable onto the new window and this is really being a pain. I believe

that this is possible but everything that I have tried so far has not
worked. The relevant code that I am usiing is below. The problem is the
variable $aster resides in a cell of a table that displays notes
pertaining to a specific item and depending on the item the notes could
change. Each table may have anywhere from 1 to 10 notes and they are
all different. I had everything working fine opening another window
without javascript but a smaller window would suffice. As of now, all
of the notes are the same and it is always the last set of notes in the
table. Anyone familiar with this? Any help would be greatly
appreciated.
<SCRIPT language="JavaScript">
<!--hide
function newwindow
{
window.open('cust_parts_notes.php?aster=<?print
($aster);?>','Notes','width=400,height=400,resizab le=yes');
}
//-->
</SCRIPT>
<tr bgcolor=white><td align="center"><?echo "$qty";?></td><td><?echo
"$partnum";?></td><td><?echo "$desc1 $desc2"?></td>
<?
if ($yes_no == "Y"){
?><td><a href="javascript:newwindow'<?print ($aster);?>')"
title='<?echo "$aster"?>'>Notes</a></td><?
} else { ?><td>&nbsp;</td><?
}
?>
</tr>
<?
}
}
odbc_close($connect);
?>
</body>
</html>

Nov 9 '06 #1
1 1136

dk*******@yahoo.com wrote:
I am trying to open a small new window using javascript and pass a php
variable onto the new window and this is really being a pain. I believe

that this is possible but everything that I have tried so far has not
worked. The relevant code that I am usiing is below. The problem is the
variable $aster resides in a cell of a table that displays notes
pertaining to a specific item and depending on the item the notes could
change. Each table may have anywhere from 1 to 10 notes and they are
all different. I had everything working fine opening another window
without javascript but a smaller window would suffice. As of now, all
of the notes are the same and it is always the last set of notes in the
table. Anyone familiar with this? Any help would be greatly
appreciated.
<SCRIPT language="JavaScript">
<!--hide
function newwindow
{
window.open('cust_parts_notes.php?aster=<?print
($aster);?>','Notes','width=400,height=400,resizab le=yes');
}
//-->
</SCRIPT>
<tr bgcolor=white><td align="center"><?echo "$qty";?></td><td><?echo
"$partnum";?></td><td><?echo "$desc1 $desc2"?></td>
<?
if ($yes_no == "Y"){
?><td><a href="javascript:newwindow'<?print ($aster);?>')"
title='<?echo "$aster"?>'>Notes</a></td><?
} else { ?><td>&nbsp;</td><?
}
?>
</tr>
<?
}
}
odbc_close($connect);
?>
</body>
</html>
If I understand you correctly, u can use the hidden form element on
your first page to sotre the data. Then you can submit your form via
javascript to be able to open a new custom window. And then just use
php to retrive the hidden field(s) value(s).

Nov 10 '06 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

1 post views Thread by Consuelo Guenther | last post: by
3 posts views Thread by domeceo | last post: by
9 posts views Thread by Max | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.