Question 1> IHow can i use HTML.Select with an Onchange event ??? (in this case a submit form event).
I have te following and it works fine, but i dont get and event in the Select!
this.lblSlcModel.Text = Html.Select("woningModel", dt,
"Name", "Id", (object)"1",
1, false, (object)"onchange='this.form.submit()'");
Question 2> How can i Select by string, now it only selects the value of the select items (in the above case value "1") ???
toinedeboer
Member
21 Points
62 Posts
Html.Select and Onchange event
Apr 17, 2008 02:39 PM|LINK
Hello ppl,
Question 1> IHow can i use HTML.Select with an Onchange event ??? (in this case a submit form event).
I have te following and it works fine, but i dont get and event in the Select!
this.lblSlcModel.Text = Html.Select("woningModel", dt, "Name", "Id", (object)"1", 1, false, (object)"onchange='this.form.submit()'");
Question 2> How can i Select by string, now it only selects the value of the select items (in the above case value "1") ???
toinedeboer
Member
21 Points
62 Posts
Re: Html.Select and Onchange event
Apr 18, 2008 10:12 AM|LINK
I found my own solution to Question 1 !
This syntax will do the trick:Html.Select(
"woningModel", dt, "Name", "Id", (object)"1", 1, false, new { @onchange ="this.form.submit()" });Now i only look for Question 2!
(How i can select by the String)
nberardi
Star
11233 Points
2352 Posts
Re: Html.Select and Onchange event
Apr 18, 2008 10:29 AM|LINK
You don't need to start onchange with an @ sign.
toinedeboer
Member
21 Points
62 Posts
Re: Html.Select and Onchange event
Apr 18, 2008 10:51 AM|LINK
Yes i know! but it can :-)
nberardi
Star
11233 Points
2352 Posts
Re: Html.Select and Onchange event
Apr 20, 2008 01:25 AM|LINK
technically you can start every variable with an @ sign but it is bad practice none the less.