I'm using Marc's SPServices jQuery library - the SPFilterDropDown script - to filter the items in a Lookup multi-select field on a New Item DVWP. It works fine if I stick some static text in there - but I'd like it to be dynamic.
I've tried a few versions.
var VARIABLE = $("#VARIABLE").html();
$(document).ready(function() {
$().SPServices.SPFilterDropdown({
relationshipList: "{LISTID}",
relationshipListColumn: "COLUMN",
columnName: "FORMCOLUMN",
listName: "{LISTID}",
noneText: "(None)",
CAMLQuery: "<Eq><FieldRef Name='VARIABLE' /><Value Type='Text'>'+ VARIABLE + '</Value></Eq>",
completefunc: null,
debug: true
});
The //var VARIABLE = $("#VARIABLE").html();//
line is my attempt at making the dynamic piece work.
I've tried many variations on the CAML query:
- '+ VARIABLE + ' vs. {VARIABLE}
- Value Type='Text' vs. Value Type='Lookup'
- Eq vs. Contains
No luck. Looking for help.
'+ VARIABLE +'
instead of double quotes? I'll be honest, I don't know the jQuery library you're using, but it seems like you're expecting it to parse a strange combination of XML and jscript.