I am using a jQuery Chained Select Plugin.
But getting stuck loading the data dynamically to select options from my Expression Engine template. Seems pulling the value from the JSON url is causing the error, manually changing the mo'variable from url_title="{get:series}" to an entry url_title="test" makes the drop down work. What could be going wrong? How can I check what the URL is the plugin is outputting?
<form>
<select id="mark-remote" data-variable="bar" name="mark">
<option value="">--</option>
<option value="bmw">BMW</option>
<option value="audi">Audi</option>
</select>
<select id="series-remote" name="series">
<option value="">--</option>
</select>
<button id="button-remote" type="submit">Button</button>
<script>
$(function() {
/* For jquery.chained.remote.js */
$("#series-remote").remoteChained({
parents: "#mark-remote",
url: "http://example.com/json",
loading: "--"
});
});
</script>
</form>
Expression Engine JSON template
{exp:http_header content_type="application/json"}
[
{"" : "--",
{exp:channel:entries channel="articles" dynamic="on" url_title="{get:series}" disable="categories|trackbacks|member_data|pagination"}
{relatedarticle backspace="3"}
"{relatedarticle:url_title}":"{relatedarticle:title}",
{/relatedarticle}
{/exp:channel:entries}
}
]
JSON output (Adding this manually to the template loads the data perfectly)
[{"" : "--", "data":"data" , "data":"data"}]