Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $(function() {
- $("#typeahead").typeahead({
- source: function (query, process) {
- $.ajax({
- url: 'data.php',
- type: 'POST',
- data: 'query=' + query,
- dataType: 'JSON',
- async: true,
- success: function(data) {
- process(data);
- }
- });
- }
- });});
- if (isset($_POST['query'])) {
- require_once('conexion.php');
- $query = $_POST['query'];
- $sql = "SELECT * FROM tab_medicinas_2 WHERE descripcion LIKE '%".$query."%'";
- $res = mysql_query($sql) or die(mysql_error());
- while($fila = mysql_fetch_assoc($res))
- {
- $return[] = $fila['descripcion']." (".$fila['um'].")";
- }
- echo json_encode($return); }
- <div id="tab4" class="tab-content-1">
- <table class="table table-bordered">
- <tr>
- <td width="28%">Denominación según DCI, especificaciones técnicas, unidad de manejo</td>
- <td width="24%">Dosis</td>
- <td width="24%">Duración del tratamiento</td>
- <td width="8%">Cant. Req.</td>
- <td width="16%">Indicación Específica</td>
- </tr>
- <tr>
- <td width="28%">
- <input name="descripcion" class="span4" id="typeahead" type="text" data-provide="typeahead" />
- </td>
- <td width="24%">
- <input name="dosis" class="span3" id="dosis" type="text" />
- </td>
- <td width="24%">
- <input name="duracion" class="span3" id="duracion" type="text" />
- </td>
- <td width="8%">
- <input name="cantidad" class="span1" id="cantidad" type="text" />
- </td>
- <td width="16%">
- <input name="indicacion" class="span2" id="indicacion" type="text" />
- </td>
- </tr>
- </table>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement