Greetings,
I'm looking for a way to pass in Model data in an on change event on the combo box but also easily retrieve the selected value.
Note, this changes the onChange event delcaration from something like:
.Events(e =>
{
e.Change("ddlOnChange");
})
To:
.Events(e =>
{
e.Change("ddlOnChange('" + Model.Values + "')");
})
Which means
function ddlOnChange(e) {
alert(e); // <-- is no longer valid, because the event is now the passed in object
alert("value: " + this.value()); // Also no longer works, because 'this' becomes the page as a whole
};
Any easy way to do this other than Jquery to the id of the control and snag the value?
Any help would be greatly appreciated.
I'm looking for a way to pass in Model data in an on change event on the combo box but also easily retrieve the selected value.
Note, this changes the onChange event delcaration from something like:
.Events(e =>
{
e.Change("ddlOnChange");
})
To:
.Events(e =>
{
e.Change("ddlOnChange('" + Model.Values + "')");
})
Which means
function ddlOnChange(e) {
alert(e); // <-- is no longer valid, because the event is now the passed in object
alert("value: " + this.value()); // Also no longer works, because 'this' becomes the page as a whole
};
Any easy way to do this other than Jquery to the id of the control and snag the value?
Any help would be greatly appreciated.