multiple custom filters

multiple custom filters

k0r54k0r54 Posts: 9Questions: 0Answers: 0
edited February 2010 in General
Hi,

I have multiple custom filters in my form but the second one isn't working. Is it something stupid I am doing?

[code]


$(document).ready(function() {

// Initialise the table
oTable = $('#admintable').dataTable({
bAutoWidth: false,
sPaginationType: "full_numbers",
});

$("select#purpose").change(function () {
var val = $("select#purpose option:selected").attr('value');
oTable.fnFilter (val,2,false);
});

$("select#usergroup").change(function () {
var val = $("select#usergroup option:selected").attr('value');
oTable.fnFilter (val,3,false);
});
});



Purpose

Show all

{VAR_PurposeSel[ArticleAdmin]}




User Group

Show all

{VAR_UsergroupSel[ArticleAdmin]}


[/code]

Please ignore the {VAR_... This is how I populate the drop downs within my project through php. The first one works fine with no problem but the second has no effect and no error.

Thanks
k0r54

Replies

  • k0r54k0r54 Posts: 9Questions: 0Answers: 0
    Sorry,

    Please ignore, another look at the source code and my php was playing up. Sorry to waste the post!

    I do have a slight other issue. For some reason I have noticed the filters seem to fail on & and brackets ().

    Is there any known reason for this?
  • MithrusMithrus Posts: 19Questions: 0Answers: 0
    edited February 2010
    It may be a encoding issue. Depending on the context, you may need to use urlencode() or htmlspecialchars() on the text in php before using in the javascript.
This discussion has been closed.