This is a migrated thread and some comments may be shown as answers.

[Solved] Set field value after DropDownBox changes

0 Answers 29 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
James
Top achievements
Rank 1
James asked on 28 Mar 2012, 03:26 PM
I am creating a form for our volunteers to keep track of the time they give to different events.  The "TimeCard" model is a VolunteerId, EventId, FromDateTime, ToDateTime.
The view is strongly typed to a TimeCard, along with a ViewBag.EventLookup.
Here is my DropDownList of Events:
@Html.Telerik().DropDownList()
.Name("EventId)
.BindTo(new SelectList(ViewBag.EventLookup,"Value", "Text"))
)

The FromDateTime and ToDateTime are @Html.EditorFor(model => model.FromDateTime) and @Html.EditorFor(model => model.ToDateTime), respectively.  I set them to DateTime.Now in the controller by default.
My EditorFor uses <%= Html.Telerik().DateTimePicker(m => m)%>

I want to update the FromDateTime and ToDateTime fields after the correct DropDownList Event has been selected.  

Thanks,
Jamie
 


 
Tags
General Discussions
Asked by
James
Top achievements
Rank 1
Share this question
or