2

I am working in a project with codeigniter and bootstrap, I made an autocomplete system, but the css looks broken like this

https://gyazo.com/4af7ae2bbdfd5547233d192b80ef947e

There is no custom style, only the bootstrap min css, here is my view html code, any help to look like it should be would be appreciated

<h2>Welcome to Crossover Laboratory</h2>
<div class="row">
<div class="col-md-1">
&nbsp;
</div>
<div class='col-md-10 text-center'>
<h3>Patients</h3>
    <?php echo $error2; ?>
    <?php 
    $attributes2 = array(
    "class"=>"form-horizontal", 
    "id" => "LoginForm2",
    "name" => "LoginForm2",
    "method" => "post"
    ); 
    echo form_open("laboratory/patients", $attributes2); ?>
    <div class="form-group">
    <input type="text" name="username_patients" id="username_patients" class="ui-autocomplete-input" value="" required placeholder="Name" />
    <p id="patient_name"></p>
    </div>

    <div class="form-group">

    <input type="password" name="password_patients" id="password_patients" value="" required placeholder="Code"/>
    </div>
    <div class="form-group">
    <?php echo form_submit("Login2","Login"); ?>    
    </div>
    <?php echo form_close(); ?>

</div>


<div class="col-md-1">
&nbsp;
</div>
</div>
<script type="text/javascript">

$(document).ready(function($) {

    $("#username_patients").autocomplete({
        source: '<?php echo site_url('laboratory/autocomplete'); ?>',
        minlenght: 2,
        html: true,
        open: function(event, ui) 
        {
            $(".ui-autocomplete").css("z-index",1000);  
        }
    });

});
</script>
2

1 Answer 1

2

I think you have missed the jQueryUI CSS references. Add the below CSS in your application <head> section and try..

<link rel="stylesheet" href="http://code.jquery.com/ui/1.11.4/themes/smoothness/jquery-ui.css">

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.