troubleshooting Question

Filling an MVC dropdown based on selections from a textbox (datepicker) .NET/Jquery/JS/MVC

Avatar of Member_2_1242703
Member_2_1242703 asked on
.NET MVCjQueryJavaScript.NET Programming
9 Comments1 Solution257 ViewsLast Modified:
I have the following 2 textboxes and dropdown


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

            <div class="form-group">
                @Html.LabelFor(model => model.EndDate, htmlAttributes: new { @class = "control-label col-md-2" })
                <div class="col-md-10">
                    @Html.EditorFor(model => model.EndDate, new { htmlAttributes = new { @class = "form-control datepicker", @id = "EndDate", required = "required" } })
                    @Html.ValidationMessageFor(model => model.EndDate, "", new { @class = "text-danger" })
                </div>
            </div>
            <div class="form-group">
                @Html.LabelFor(model => model.Hours, htmlAttributes: new { @class = "control-label col-md-2" })
                <div class="col-md-10">
                    @Html.DropDownListFor(model => model.Hours, (SelectList)ViewBag.hoursddl, "", htmlAttributes: new { @class = "form-control", required = "required" })
                    @Html.ValidationMessageFor(model => model.Hours, "", new { @class = "text-danger" })
                </div>
            </div>

I need to populate the dropdown based on the DateDiff multiplied by 8. Or I guess DateDiff + 1 * 8 minus 1 until it hits 1.
So if 3/1/2016 and 3/4/2016 are selected in the textboxes respectively, the dropdown would fill with 32, 31, 30, 29, 28, 27, 26, 25, 24, and so on until it reaches 1.

Any ideas?
ASKER CERTIFIED SOLUTION
Join our community to see this answer!
Unlock 1 Answer and 9 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 9 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros