airdee Posted May 2, 2007 Share Posted May 2, 2007 my form works when i select something on the province pull down menu, it will generate another listing of area pull down menu. my problem is when the form is save (process.php), it saves nothing on select name='city'. and why is it that when i view the source code of addlisting.php, nothing is printed on the ajax part (getarea.php) even though it is visible on the web page? please help. ------->process.php ------->selectarea.js ------->getarea.php <?php $q=$_GET["q"]; $con = mysql_connect('localhost', 'username', 'pass'); if (!$con) { die('Could not connect: ' . mysql_error()); } mysql_select_db("thedb", $con); $sql="SELECT * FROM province_to_area WHERE id = '".$q."'"; $result = mysql_query($sql); echo "<select class='select' name='city'>"; while($row = mysql_fetch_object($result)){ $id=$row->id; $name=$row->area; echo "<option value='$id'"; echo ">$name</option>"; } echo "</select>"; ?> ------->addlisting.php this part is within a form with submit button to action=process.php <tr> <td class="inputlbl">Province/State:</td> <td width="65%"> <select class="select" name="province" onchange="showUser(this.value)"> <? $result=mysql_query("select * from province"); while($row=mysql_fetch_object($result)){ $id=$row->id; $name=$row->name; echo "<option value='$id'"; echo ">$name</option>\n"; } ?> </select> </td> </tr> <tr> <td class="inputlbl">Area:</td> <td id="txtHint" width="65%">Please select province </td> </tr> Please let me know if you need some other info. thank you very much. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.