• 0
Sign in to follow this  
Valter Almeida

Como montar script

Question

Tarde preciso montar um Javascript onde quando carrego o numero do requisição ele já me tras os campos de KM, Vehicle e supportPoint que estao na tabela do Numero da requisição


                    @{
                        using (webTR.Models.DataContext dataContext = new webTR.Models.DataContext())
                        {
                            var ListRequisition = await dataContext.RequisitionSupply.OrderBy(q => q.RequisitionSupplyID).Select(q => new SelectListItem
                            {
                                Value = q.RequisitionSupplyID.ToString(),
                                Text = q.RequisitionSupplyID.ToString()

                            }).OrderBy(q => q.Text).ToListAsync();

                            <div class="form-group col-6 col-sm-6 col-md-4 col-lg-1">
                                <label asp-for="Supply.RequisitionSupplyID"></label>
                                <select class="form-control form-control-sm text-body" asp-for="Supply.RequisitionSupplyID " asp-items="ListRequisition" disabled>
                                    <option value=""></option>
                                 
                                </select>
                                <span asp-validation-for="Supply.RequisitionSupplyID" class="valid-tooltip"></span>
                                @Html.HiddenFor(q => q.Supply.RequisitionSupplyID)
                            </div>
                        }

                       <div class="form-group col-6 col-sm-6 col-md-4 col-lg-1">
                            <label asp-for="Supply.KM"></label>
                            <input id="inputKM"  asp-for="Supply.KM" type="text" class="form-control form-control-sm text-uppercase" readonly />
                            <span asp-validation-for="Supply.KM" class="valid-tooltip"></span>
                            @Html.HiddenFor(q => q.Supply.KM)
                        </div>

                      <div class="form-group col-6 col-sm-6 col-md-4 col-lg-1">
                            <label asp-for="Supply.VehicleID"></label>
                            <input  asp-for="Supply.VehicleID" class="form-control form-control-sm text-uppercase" readonly />
                            <span asp-validation-for="Supply.VehicleID" class="valid-tooltip"></span>
                            @Html.HiddenFor(q => q.Supply.VehicleID)

                        </div>
                        <div class="form-group col-6 col-sm-6 col-md-4 col-lg-1">
                            <label asp-for="Supply.SupportPointID"></label>
                            <input asp-for="Supply.SupportPointID" class="form-control form-control-sm text-uppercase" readonly />
                            <span asp-validation-for="Supply.SupportPointID" class="valid-tooltip"></span>
                            @Html.HiddenFor(q => q.Supply.SupportPointID)
                        </div>

Edited by Valter Almeida

Share this post


Link to post
Share on other sites

0 answers to this question

Recommended Posts

There have been no answers to this question yet

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Sign in to follow this