javascript popups and php record sets

I have the following dropbox in a web page:

<select name="txtName" class="input_boxes_orders_add" id="txtName" onchange="javascript:custpopup()";>
                  <option value="Select Name">Select Name</option>
                  <?php
do {  
?><option value="<?php echo $row_cust['Name']?>"><?php echo $row_cust['Name']?></option>
                  <?php
} while ($row_cust = mysql_fetch_assoc($cust));
  $rows = mysql_num_rows($cust);
  if($rows > 0) {
      mysql_data_seek($cust, 0);
        $row_cust = mysql_fetch_assoc($cust);
  }
?>                </select>
This allows me to select a name from a database and it has an "onchange2event to call the following script:

<SCRIPT language="JavaScript">
<!--
//hide

function custpopup()
{
window.open('http://localhost/comwebsites/1callorders/site/cust_find_visit_byname.php?txtName=<?php echo $row_cust['Name']?>&button2=Find','jav','width=850,height=175,resizable=yes,scrollbars=yes,location=1');
}
function MM_popupMsg(msg) { //v1.0
  alert(msg);
}
//-->
</SCRIPT>

When I select a name from the dropbox, the popup opens the correct page buit the name is not being passed to the page recordset. If I hard code the name in the javascript in stead of using the php tags, the popup page opens and the correct name is passed to the recordset on the page and the correct information is displayed, so I know it works.

Question:
How can I get the selected name from the dropdown box to be passed to the popup page using this javascript and the php tags ?


doctorbillTechAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

doctorbillTechAuthor Commented:
sorry:
The "onchange2event  should be "onchange event"
0
Gurvinder Pal SinghCommented:
make it
onchange="javascript:custpopup(this.value)";>


function custpopup(value)
{
window.open('http://localhost/comwebsites/1callorders/site/cust_find_visit_byname.php?txtName=' + value + '&button2=Find','jav','width=850,height=175,resizable=yes,scrollbars=yes,location=1');
}
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
doctorbillTechAuthor Commented:
excellent - just what I needed, and such a fast response !!!!!
Thanks a lot
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
JScript

From novice to tech pro — start learning today.