4
Contributors
14
Replies
23
Views
6 Years
Discussion Span
Last Post by madCoder
0

I have a list of areas in a DB and want to call these out to a Combo Box:

0

Just output the right html tags in the right order. When you have some code, I'll help. Try yourseld first.

0

this is code . i want to get data in fields when i select option in cobm box.

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

 <?
 include("connection.php");
 
 $name=mysql_query("select * from doctor_schedule_information ");
 $myrow=mysql_fetch_array($name);
 

//$sql=mysql_query("select * from doctor_schedule_information where doctor_ID=$res[doctor_ID]");




 
   
  ?>


<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Untitled Document</title>
<link href="style.css" rel="stylesheet" type="text/css" />
<style type="text/css">
<!--
.style1 {font-weight: bold}
.style2 {
	font-size: large;
	font-weight: bold;
}
-->
</style>
</head>

<body >
<p align="center" class="style1">
WELCOME TO ONLINE INFORMATION SYSTEMS FOR HOSPITAL EMERGENCY DEPARTMENT
<p/>

<div class="transbox2">
  <h1><center> MAKE CHANGESES IN DOCTORS DUTIE </center></h1>
  
  <form name="adm_set_doct_duties" method="post" action="a_task_2_1.php" >
  
 
  
  
  
  
  
  
  <table width="598" height="364" border="0" align="center">

    <tr>
      <td >doctor ID</td>
      <td ><select name="user" id="user">
  <?
  while($res=mysql_fetch_assoc($name))
  {
  ?>
  <option  >select a doctor ID :
  <?
  echo $res['doctor_ID']
  ?>
  
  </option>
  <?
  }
  ?>
  </select></td>
	  </tr>
	 
	<tr>
      <td >doctors name</td>
      <td ><input type="text" name="d_n" id="d_n" value="<? echo $myrow['doctors_name'] ?>"></td>      
    </tr>
	
	<tr>
      <td >monday</td>
      <td ><input type="text" name="m" id="m" value="<? echo $myrow['monday'] ?>"></td>      
    </tr>
	<tr>
      <td >tuesday</td>
      <td ><input type="text" name="t" id="t" value="<? echo $myrow['tuesday'] ?>"></td>      
    </tr>
	<tr>
      <td >wednesday</td>
      <td ><input type="text" name="w" id="w" value="<? echo $myrow['wednesday'] ?>"></td>      
    </tr>
	<tr>
      <td >thursday</td>
      <td ><input type="text" name="th" id="th" value="<? echo $myrow['thursday'] ?>"></td>      
    </tr>
	<tr>
      <td >friday</td>
      <td ><input type="text" name="f" id="f" value="<? echo $myrow['friday'] ?>"></td>      
    </tr>
	<tr>
      <td >saturday</td>
      <td ><input type="text" name="st" id="st" value="<? echo $myrow['saturday'] ?>"></td>      
    </tr>
	<tr>
      <td >sunday</td>
      <td ><input type="text" name="su" id="su" value="<? echo $myrow['sunday'] ?>"></td>      
    </tr>
	

    	<tr>
	<td>&nbsp;</td>
   <td><input type="submit" name="submit" id="submit" value="SAVE"  /></td>
   <td><input type="reset" name="reset" id="reset" value="RESET" /></td>
   
	</tr>

  </table>
  </form>
</div>


</body>
</html>
0

i want the form to be loaded when i select from combo box .it has to match the ID then load that ID`s data in that form.
can u plzz help me out

0

i want the form to be loaded when i select an option from combo box .it has to match the ID then load that ID`s data in that form.
can u plzz help me out

<?
  while($res=mysql_fetch_assoc($name))
  {
  ?>
  <option  >select a doctor ID :
  <?
  echo $res['doctor_ID']
  ?>
 
  </option>
  <?
  }
  ?>
  </select></td>
	  </tr>
0

i want to know that it will be code that when i select any option in combo box after selecting that the form will be filled . for example i have selected an ID in combo box then the form will be filled with that ID`s name age etc from database

0

Yeah, that's the gist of it.

<label for="doctor_id">Select a doctor:</label>
<select name="doctor_id">
<?php
while($doctor = mysql_fetch_assoc($name))
{
  printf('<option value="%d">%s, %s</option>', $doctor['id'], $doctor['surname'], $doctor['name']); 
}
?>
</select>
This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.