Aqui el codigo que tengo:
<html >
<head>
<title>Sistema</title>
<script language="JavaScript" src="js/jquery-1.5.1.min.js"></script>
<script language="JavaScript" src="js/jquery-ui-1.8.13.custom.min.js"></script>
<link type="text/css" href="css/ui-lightness/jquery-ui-1.8.13.custom.css" rel="stylesheet" />
</head>
<body>
<div>
<H1>Llene todos los datos del formulario:</H1>
<BR>
<form name="form1" action="recipepdf.php" method="POST">
<td>Escriba nombre del medicamento:</td>
<?php
include("conexion.php");
$con = "select * from medicamento";
$query = mysql_query($con);
?>
<script>
$(function() {
<?php
while($row= mysql_fetch_array($query)) {//se reciben los valores y se almacenan en un arreglo
$elementos[]= '"'.$row['med_comercial_1'].'"';
}
$arreglo= implode(", ", $elementos);//junta los valores del array en una sola cadena de texto
?>
var availableTags=new Array(<?php echo $arreglo; ?>);//imprime el arreglo dentro de un array de javascript
$( "#tags" ).autocomplete({
source: availableTags
});
});
</script>
<label for="tags"></label>
<input id="tags" name="nombre">
<td>Forma Farmaceutica:</td>
<td><input name="present" type="text" id="present" size="30"></td><br>
<td>Via de Administracion:</td>
<td><input name="viadmin" type="text" id="viadmin" size="30"></td><br>
<td>Marcas Comerciales:</td>
<td><input name="marca" type="text" id="marca" size="30"></td><br>
</tr><br>
<input name="Enviar" type="submit" value="PDF">
</form>
</BODY>
</HTML>
Les agradezco la ayuda
![sonriente](http://static.forosdelweb.com/fdwtheme/images/smilies/smile.png)