Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- firstValSelectFilter.on("change", function() {
- var objValue = $(this).val();
- if ($(this).val() == "") {
- $(this)
- .parent()
- .next()
- .find("select")
- .html("<option value=''>Не выбрано</option>");
- } else {
- $.ajax({
- url: "/ajax.php",
- context: this,
- type: "POST",
- data: "object=" + objValue + "&ajax=true",
- success: function(data) {
- var obj = $.parseJSON(data);
- var toAppend = "<option value=''>Не выбрано</option>" + "";
- for (index in obj) {
- toAppend +=
- "<option value=" +
- obj[index].id +
- ">" +
- obj[index].title +
- "</option>";
- }
- $(this)
- .parent()
- .next()
- .find("select")
- .html(toAppend);
- /*$(this)
- .parent()
- .next()
- .find("select")
- .selectize();*/
- }
- });
- }
- //$('#onSubobject').selectize();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement