Very new to JQuery and MVC and webdevelopment over all.
I’m now trying to accomplish this and is asking for a bit of advise:
I’m basically trying to build a filter with 4 input elements, and 1 output.
I have 4 select (drop down) elements in my page. As soon as one of them is changed, I need to build a href and get the partial view with the return values.
My question is now if I should try to build the href in the select element or if I can do it once in jquery, and don’t have to have duplicated code. How would I accomplish this?
each dropdown should be
class="FilterSelect"or something like thatwhen any of them change, it’ll fire off a request to a URL that needs to be specified in a context available to all selects.
the following pseudo-code should give an idea:
Just to note: you shouldn’t build your URL in jQuery because client-side logic shouldn’t be concerned with the rules required to build a URL that corresponds to the server-side routing.
…. & also to note: I don’t know if this is even valid jQuery!
.parents('#FilterContainer')