Home How to get item detail after choosing in autocomplete textbox using jquery?
Reply: 0

How to get item detail after choosing in autocomplete textbox using jquery?

Ali Harahap
1#
Ali Harahap Published in 2017-09-12 06:09:18Z

How to get more detail values from database after choosing field using viewbag Below my form :

 <div class="form-group">
        <label class="control-label col-md-2">Employe Code</label>
        <div class="col-md-10">
            @Html.DropDownList("Id", (IEnumerable<SelectListItem>)ViewBag.StrContact, new { @class = "form-control select2" })
            @Html.ValidationMessageFor(model => model.Id, "", new { @class = "text-danger" })
        </div>
    </div>

    <div class="form-group">
        @Html.LabelFor(model => model.Name, htmlAttributes: new { @class = "control-label col-md-2" })
        <div class="col-md-10">
            @Html.EditorFor(model => model.Name, new { htmlAttributes = new { @class = "form-control" } })
            @Html.ValidationMessageFor(model => model.Name, "", new { @class = "text-danger" })
        </div>
    </div>

    <div class="form-group">
        @Html.LabelFor(model => model.Phone, htmlAttributes: new { @class = "control-label col-md-2" })
        <div class="col-md-10">
            @Html.EditorFor(model => model.Phone, new { htmlAttributes = new { @class = "form-control" } })
            @Html.ValidationMessageFor(model => model.Phone, "", new { @class = "text-danger" })
        </div>
    </div>

    <div class="form-group">
        @Html.LabelFor(model => model.Address, htmlAttributes: new { @class = "control-label col-md-2" })
        <div class="col-md-10">
            @Html.EditorFor(model => model.Address, new { htmlAttributes = new { @class = "form-control" } })
            @Html.ValidationMessageFor(model => model.Address, "", new { @class = "text-danger" })
        </div>
    </div>

enter image description here

if I choosing the employee code it will look up in the database for getting name, phone address.

Thank You.

You need to login account before you can post.

About| Privacy statement| Terms of Service| Advertising| Contact us| Help| Sitemap|
Processed in 0.262487 second(s) , Gzip On .

© 2016 Powered by cudou.com design MATCHINFO