doctorbill
asked on
php popup script
I have the following scripts on a php page, which is working correctly:
Drop box script value:
----------------------
onchange="javascript:custp opup(this. value)"
Script called:
-------------------
<SCRIPT language="JavaScript">
<!--
//hide
function custpopup(value)
{
window.open('http://localhost/comwebsites/1callorders/site/cust_find_visit_byname_comment.php?txtName='+ value + '&button2=Find','jav','wid th=650,hei ght=125,re sizable=ye s,scrollba rs=yes,loc ation=1');
}
function MM_popupMsg(msg) { //v1.0
alert(msg);
}
//-->
</SCRIPT>
The value selected in the drop box is passed to the page in the function "custpopup" and brings up the correct data on the referenced php page. I need the popup window to ONLY SHOW ITSELF when the dataset it is calling has data in a particular field (comment). This dataset is on the referenced php page:
<?php echo $row_comment['comment']; ?>
Drop box script value:
----------------------
onchange="javascript:custp
Script called:
-------------------
<SCRIPT language="JavaScript">
<!--
//hide
function custpopup(value)
{
window.open('http://localhost/comwebsites/1callorders/site/cust_find_visit_byname_comment.php?txtName='+ value + '&button2=Find','jav','wid
}
function MM_popupMsg(msg) { //v1.0
alert(msg);
}
//-->
</SCRIPT>
The value selected in the drop box is passed to the page in the function "custpopup" and brings up the correct data on the referenced php page. I need the popup window to ONLY SHOW ITSELF when the dataset it is calling has data in a particular field (comment). This dataset is on the referenced php page:
<?php echo $row_comment['comment']; ?>
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
I will try this solution today but it looks as if the script will give me an alert message if the $row_comment has a value.
What I am after is the popup window ( window.open('http://localhost/comwebsites/1callorders/site/cust_find_visit_byname_comment.php?txtName='+ value + '&button2=Find','jav','wid th=650,hei ght=125,re sizable=ye s,scrollba rs=yes,loc ation=1'); )
only showing if the $row_comment has a value
What I am after is the popup window ( window.open('http://localhost/comwebsites/1callorders/site/cust_find_visit_byname_comment.php?txtName='+ value + '&button2=Find','jav','wid
only showing if the $row_comment has a value
ASKER
Here is my latest code. This works as it should if I enter a value into the '+ value +' field. What I need to be able to do is to create a variable which gets this value from a dropdown box on my page. I have tried using the following:
var value = (document.form2.txtName.va lue)
This does not work. This is the ONLY thing which is stopping this script from running.
How do I define a variable from a dropbox to be used in the javascript below ?
php Code:
-------------------------- ---------- ---------
if(isset($row_custCom['com ment'])){
echo "<SCRIPT language = JavaScript>
var value = (document.form2.txtName.va lue)
window.open('http://localhost/comwebsites/1callorders/site/cust_find_visit_byname_comment.php?txtName='+ value + '&button2=Find','jav','wid th=650,hei ght=125,re sizable=ye s,scrollba rs=yes,loc ation=1')
</SCRIPT>";
}
var value = (document.form2.txtName.va
This does not work. This is the ONLY thing which is stopping this script from running.
How do I define a variable from a dropbox to be used in the javascript below ?
php Code:
--------------------------
if(isset($row_custCom['com
echo "<SCRIPT language = JavaScript>
var value = (document.form2.txtName.va
window.open('http://localhost/comwebsites/1callorders/site/cust_find_visit_byname_comment.php?txtName='+ value + '&button2=Find','jav','wid
</SCRIPT>";
}
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
didn't completely solve the problem
ASKER