combobox - Jquery two sets of 3 comboxboxes - one set listening on the other -


I have a strange problem, get two simple calls below and returning HTML from another file I'm receiving HTML is 3 comboxes and one combox selects incidents on them Other pop ulates everything works fine

If I get HTML in DV then I have the I but if I call the file twice And I add it to two devices. If I choose a combobox on the first set, then the second set is also changing. Whatever happens on the first set of 3 boxes is automatically happening on the second set and it is the opposite. But I need to have these two sets independent.

jQuery:

  $ .get ("cars.php", {Mix: 'GM', Model: 'Chevy', Year: '2009'}, Function (Payer) {$ ("#pplus"). Append (payer);}); $ ("Cars. Php", {Make: 'Honda', Model: 'Civic', Year: '2008'}, Function (cursor) {$ ("#Verpal"). Attachment (cursor);});   

HTML:

  & lt; Div id = "perplace" & gt; & Lt; / Div & gt; & Lt; Div id = "curplace" & gt; & Lt; / Div & gt;   

HTML (Reduce the CSS and reduce the value to simplify it):

   
select ID = " Create "& gt; & Lt; Option value = "1" & gt; GM & lt; / Options & gt; & Lt; Option value = "2" & gt; HONDA & lt; / Options & gt; & Lt; Option value = "3" & gt; Ford & lt; / Option & gt; & Lt; / Select & gt; & Lt; Select ID = "Model" & gt; & Lt; Option value = "1" & gt; Chevy & lt; / Options & gt; & Lt; Option value = "2" & gt; Pontiac & lt; / Options & gt; & Lt; / Select & gt; & Lt; Select ID = "year" & gt; & Lt; Option value = "1" & gt; 2000 & lt; / Options & gt; & Lt; Option value = "2" & gt; 2001 & lt; / Options & gt; & Lt; Option value = "3" & gt; 2002 & lt; / Options & gt; & Lt; / Select & gt; & Lt; / Div & gt;

We had to face the same problem and likewise we resolved it.

We prefixed the request with the control (e.g., GetCar (Honda) controls hondamake , honda amodel , Honda_Year ). Whenever we want to see that scene, we were able to gain unique control (we use MVC) the way we handled events, that function (eg PopulateYear (YearDropdown)) ; And the way we say that function is going to be under control in the PopulateYear ($ ("# Honda_Year"). );

Comments