Jump to content

Recommended Posts

Hello ..

I have an interface that has a text field and a button. When the user clicks on the button it opens a pop-up screen. I am trying to display in the pop-up screen what the user has entered in the text field. I have put in a varialbe and tried to use it in the pop-up screen but it doesn't work. Does any one knows how to fix this problem.

Regards,
firedrop
Link to comment
https://forums.phpfreaks.com/topic/5526-pop-up-doesnt-show-the-variable/
Share on other sites

please post your code so we can see where the error is.

Snowdog



[!--quoteo(post=357370:date=Mar 22 2006, 02:30 PM:name=firedrop)--][div class=\'quotetop\']QUOTE(firedrop @ Mar 22 2006, 02:30 PM) [snapback]357370[/snapback][/div][div class=\'quotemain\'][!--quotec--]
Hello ..

I have an interface that has a text field and a button. When the user clicks on the button it opens a pop-up screen. I am trying to display in the pop-up screen what the user has entered in the text field. I have put in a varialbe and tried to use it in the pop-up screen but it doesn't work. Does any one knows how to fix this problem.

Regards,
firedrop
[/quote]
This is the first interface

=====================================================

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css">
<!--
.style1 {font-size: 9}
.style2 {
color: #FFFFFF;
font-weight: bold;
}
-->
</style>
</head>
<script language="JavaScript1.2">
function poponload($ProspectSearch)
{
testwindow= window.open ("Database.php", "mywindow",
"location=1,status=1,scrollbars=1,width=400,height=400");
testwindow.moveTo(0,0);
}
</SCRIPT>
<body>

<?php

if (isset($_POST['BtnNote'])) {

switch ($_POST['BtnNote']) {
case 'Search':

//$NoteSurname = $_POST['ProspectSearch'];
print "the surname is $ProspectSearch";
//echo 'Button Search was pressed<br>';
break;
case 'Add Note':
echo 'Button Add Note was pressed<br>';
break;
case 'View Note':
echo 'Button View Note was pressed<br>';
break;
}
}




?>

<form name="form1" method="post" action="">
<div align="center">
<table width="381" border="0" align="center">
<tr bgcolor="#0033FF">
<td colspan="3"><div align="center" class="style2">Notes </div></td>
</tr>
<tr bgcolor="#EEEEEE">
<td width="142"><div align="left"><span class="style1">Prospect Suname </span></div></td>
<td width="147"><div align="left"><span class="style1">
<input name="ProspectSearch" type="text" id="ProspectSearch">
</span></div></td>
<td width="78"><div align="left"><span class="style1">
<input name="BtnNote" type="submit" id="BtnSearch2" onClick="poponload()" value="Search">
</span></div></td>
</tr>
<tr bgcolor="#EEEEEE">
<td colspan="3"><textarea name="NotesBoard" cols="55" rows="7" id="textarea3"></textarea></td>
</tr>
<tr bgcolor="#EEEEEE">
<td colspan="3"><div align="center">
<input name="BtnNote" type="submit" id="BtnNote" value="Add Note">
<input name="BtnNote" type="submit" id="BtnNote" value="View Note">
</div></td>
</tr>
</table>
</div>
</form>
</body>
</html>

==============================================================

This is the pop-up

==============================================================

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>

<body>

<?php

$NoteSurname = $_POST['ProspectSearch'];
print "the surname is $NoteSurname";


require('connection.php');

$query = "SELECT surname, givenname FROM prospect";
$result = mysql_query($query);

$count = mysql_num_rows($result);


if ($result)
{
$i = -1;

while($data = mysql_fetch_array($result))
{

$i = $i + 1;
$firstname[$i] = $data["givenname"];
$surname[$i] = $data["surname"];

}

print "<form name=\"form1\" method=\"post\" action=\"\">";
print "<table width=\"200\" border=\"1\">";

print "<tr>";
print "<td>&nbsp;</td>";
print "<td>Surname</td>";
print "<td>First Name </td>";
print "</tr>";



for ($x = 0; $x < $count; $x++)
{

print "<tr>";
print "<td><input name=\"radiobutton\" type=\"radio\" value=\"$firstname[$x]\"></td>";

print "<td>$surname[$x]</td>";
print "<td>$firstname[$x]</td>";

print "</tr>";
}

print "</table>";
print "</form>";


}
else
{
print "ERROR";
}




?>

</body>
</html>
This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.