0

How can I get a selected variables from multiple select box then do a $.post request to the server?

I see that there is a data input under jQuery documentation and it says the type is either object or string but I cannot seem to figure out how I can transform retrieved selected values from multi select box via jQuery, add another field and value called {check_industry: "1"} then add this as a data below where it says {here}

$.post("/get-tree", {here},
                 function(data) {
                   console.log(data);
                 }, 
                 "html"
                );
1
  • can you clarify what you mean by "get a selected variables from multiple select box then do a $.post"? Are you just trying to do an AJAX call using a select control? Commented Mar 20, 2013 at 0:57

1 Answer 1

1

Expanding on @clav to limit to just one select item of interest:

$.post("/get-tree", 
    { check_industry: $('#idOfSelectBox').val() },
    function(data) {
        console.log(data);
    }, 
    "html"
);
Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.