FireFox! The PHP Forum Loans and Credit
Panama Web Design for Hire Free Insurance Quotes!
Web Hosting Advertise Here $10 a Month Designer Children
Never Pay Taxes Again HGH Domain name registration
Web Hosting and Dedicated Servers Insurance Affordable web-hosting


HomeWatched TopicsRegisterSearchDirectory
FAQMemberlistUsergroupsLog inStoresItemsBank
Google

Reply to topic Page 1 of 1
how to reload a page with data from a textbox of a form
Message  
Reply with quote
Post how to reload a page with data from a textbox of a form 
Hi
i have a table1 with fields clientid, date and filename along with other fields.

i have to fill another table2 and i am using html form for that. in this form the user gets the client ids populated in a dropdown from the table1. the user selects a date which is taken in a text box using a simple javascript calendar. now the filename matching to the corresponding clientid and date has to be dynamically populated in a drop down.

i am able to populate the filename drop down corresponding to a client id. i am making a mysql query for that. and then make the page reload. But i am unable to get the list populated using the combination of both the fields(clientid and date)...how do i do it?

i think i am passing the value of the textbox in a wrong way. here is my code n relevant parts:
____________________________________________________________________

<script type="text/javascript">
function reload(form){
var val=form.clientid.options[form.clientid.options.selectedIndex].value;

var val1=form.receivedon.value;
//Thie line below doesnt work
//self.location='dbinven_entry.php?clientid=' + val '&receivedon=' + val1

self.location='dbinven_entry.php?clientid=' +val;
}


</script>

</head>

<body>
<?php
echo"<h1><center>Database Inventory</h1></center>";
$quer2=mysql_query("SELECT DISTINCT clientid FROM ClientInfo");

$clientid=$_GET['clientid'];
$receivedon=$_GET['receivedon'];
if(isset($clientid) and strlen($clientid) > 0){
$quer=mysql_query("SELECT DISTINCT filename FROM ddi where clientid='$clientid'");
}else{$quer=mysql_query("SELECT DISTINCT filename FROM ddi"); }


echo "<form action=inserttodbinven.php method=post name=dbinven >";

//Starting of clientID drop downlist autofed from ClientInfo //
echo "<table> <tbody>";
echo "<tr>";
echo "<td>";
echo "<label for ='clientid'>Client ID:</label></td>";
echo "<td><select name='clientid' onchange=\"reload(this.form)\"><option value=''>Select one</option>";
while($noticia2 = mysql_fetch_array($quer2)) {
if($noticia2['clientid']==@$clientid){echo "<option selected value='$noticia2[clientid]'>$noticia2[clientid]</option>"."<BR>";}
else{echo "<option value='$noticia2[clientid]'>$noticia2[clientid]</option>";}
}
echo "</select></td></tr>";

//end of the drop down list //
?>
<tr><td><label for="receivedon">Received on:</label></td>
<td><input type="text" name="receivedon" id="receivedon" value= "<?php $receivedon ?>" readonly onclick="fPopCalendar('receivedon')" /></td></tr>
<?php

echo "<tr><td><label for ='filename'>Parent File Name:</label></td>";
echo "<td><select name='filename'><option value=''>Select one</option>";
while($noticia = mysql_fetch_array($quer)) {
echo "<option value='$noticia[filename]'>$noticia[filename]</option>";
}
?>
______________________________________________________________________

thanks in advance for your help!

View user's profile Send private message
Display posts from previous:
Reply to topic Page 1 of 1
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
  



Google

FireFox! The PHP Forum Loans and Credit
Panama Web Design for Hire Free Insurance Quotes!
Web Hosting Advertise Here $10 a Month Designer Children
Never Pay Taxes Again HGH Domain name registration
Web Hosting and Dedicated Servers Insurance Affordable web-hosting


Web Design by PlatinumShore.com & Web Hosting by TradeWebHosting.com