ExpressionEngine CMS
Open, Free, Amazing

Thread

This is an archived forum and the content is probably no longer relevant, but is provided here for posterity.

The active forums are here.

[An Error Was Encountered] The URI you submitted has disallowed characters

January 07, 2010 9:55pm

Subscribe [4]
  • #1 / Jan 07, 2010 9:55pm

    maria clara

    315 posts

    hi to all,

    i am creating a detail list in the jqgrid with the onSelectRow..but it shows me an error in my console like this:

    <div id="content">
            <h1>An Error Was Encountered</h1>
            The URI you submitted has disallowed characters.    </div>

    and here is the code in the CONTROLLER:

    onSelectRow: function(ids) { 
            if(ids == null) { 
                    ids=0;
                    if(jQuery("#detFlex1").jqGrid('getGridParam','records') >0 )
                    { 
                        jQuery("#detFlex1").jqGrid('setGridParam',{url:"root + mod + '/detaillistview'"+ids,page:1}); 
                        jQuery("#detFlex1").jqGrid('setCaption',"System User Detail: "+ids)
                        .trigger('reloadGrid'); 
                    }
            } else { 
                   jQuery("#detFlex1").jqGrid('setGridParam',{url:"root + mod + '/detaillistview'"+ids,page:1}); 
                   jQuery("#detFlex1").jqGrid('setCaption',"System User Detail: "+ids) 
                   .trigger('reloadGrid'); 
                   } 
    }
    }); 
         jQuery("#listFlex").jqGrid(','#pager2',{edit:true,add:true,del:true,search:true,refresh:true },
            {}, // edit options 
            {}, // add options 
            {}, //del options 
            {multipleSearch:true}); 
        
         jQuery("#listFlex").jqGrid('navButtonAdd','#pager2',{ 
                            caption: "Columns", 
                            title: "Reorder Columns", 
                            onClickButton : function (){ 
                                jQuery("#listFlex").jqGrid('setColumns');
                                } 
        }); 
    $("#listFlex").jqGrid(','#detFlexlist',{add:false,edit:false,del:false});
    $('#detFlex1').jqGrid
    (
        {
            url: root + mod + '/detaillistview',    
            editurl: root + mod + '/post2',         
            datatype: "json", 
            mtype: 'POST',
            colNames : [ '','Company Code', 'Company Name', '','' ],
            colModel : [
                 {name : 'checkbox', index: 'checkbox', width : 15, align : 'left', process:checkDetails}          
                ,{name : 'company_code', index: 'company_code', width : 80, align : 'left'}
                ,{name : 'company_name', index: 'company_name', width : 120, align : 'left'}
                ,{name : 'company_id', index: 'company_id', hidden:true}        
                ,{name : 'company_access_id', index: 'comapny_access_id',hidden:true}
                ],
            rowNum:10, 
            rowList:[10,20,30], 
            pager: '#detFlexlist', 
            sortname: 'company_code',
            viewrecords: true, 
            sortorder: "asc", 
            autowidth: true,
            height: "200",
            caption:"System User Detail List "
    }).navGrid('#pager10_d',{add:false,edit:false,del:false});

    i think the url:“root + mod + ‘/detaillistview’” scripts are the responsible for the error…
    hope anyone could help me…


    thanks in advance,
    maria :’(

  • #2 / Jan 07, 2010 11:16pm

    WebsiteDuck

    93 posts

    jQuery("#detFlex1").jqGrid('setGridParam',{url:"root + mod + '/detaillistview'"+ids,page:1});

    I think maybe this should be

    jQuery("#detFlex1").jqGrid('setGridParam',{url: root + mod + '/detaillistview'+ids,page:1});

    Also looks like there might be other problems, but try fixing those url params and see what happens

  • #3 / Jan 07, 2010 11:40pm

    maria clara

    315 posts

    jQuery("#detFlex1").jqGrid('setGridParam',{url:"root + mod + '/detaillistview'"+ids,page:1});

    I think maybe this should be

    jQuery("#detFlex1").jqGrid('setGridParam',{url: root + mod + '/detaillistview'+ids,page:1});

    Also looks like there might be other problems, but try fixing those url params and see what happens

    i did what you have advised but it shows this error in my console:

    <div id="content">
            <h1>404 Page Not Found</h1>
            The page you requested was not found.    
    </div>

    in the CONTROLLER:

    onSelectRow: function(ids) {
                    if(ids == null) { 
                            ids=0; 
                            if(jQuery("#detFlex1").jqGrid('getGridParam','records') >0 ) 
                                { 
                                    jQuery("#detFlex1").jqGrid('setGridParam',{url:root + mod + '/detaillistview'+ids,page:1}); 
                                    jQuery("#detFlex1").jqGrid('setCaption',"System User Detail: "+ids) 
                                    .trigger('reloadGrid'); 
                                } 
                 } else { 
                             jQuery("#detFlex1").jqGrid('setGridParam',{url:root + mod + '/detaillistview'+ids,page:1}); 
                             jQuery("#detFlex1").jqGrid('setCaption',"System User Detail: "+ids) 
                            .trigger('reloadGrid');
                        } 
            }

     

    THANKS,
    maria

  • #4 / Jan 07, 2010 11:42pm

    jmadsen

    438 posts

    This might be something new that has popped up in 1.7

    read:
    http://davidmichaelthompson.com/2009/09/03/fixed-the-uri-you-submitted-has-disallowed-characters-error-codeigniter/

    for a fix that works - I am interestin gin hearing more from more knowledgeable people on this “bug”? and the suggested fix.

  • #5 / Jan 07, 2010 11:53pm

    maria clara

    315 posts

    This might be something new that has popped up in 1.7

    read:
    http://davidmichaelthompson.com/2009/09/03/fixed-the-uri-you-submitted-has-disallowed-characters-error-codeigniter/

    for a fix that works - I am interesting in hearing more from more knowledgeable people on this “bug”? and the suggested fix.

    hi,

    thanks for the article..i will read this to learn more from this bug i encounter..
    i will post here if i got this error right..


    regards,
    maria 😉

  • #6 / Jan 07, 2010 11:54pm

    WebsiteDuck

    93 posts

    The bug that jmadsen mentioned concerning dashes in the URI could be the problem if you’re passing through dashes, but I’m not sure thats the problem.

    Have you defined the root and mod variables in your javascript code?

    Also I just noticed you don’t have a forward slash at the end of your url

    jQuery("#detFlex1").jqGrid('setGridParam',{url: root + mod + '/detaillistview/'+ids,page:1});

    Try that also

  • #7 / Jan 07, 2010 11:57pm

    maria clara

    315 posts

    @bkaxrf,

    it seems that the problem is in the scripts i made..because i do put the details in the CONTROLLER and it calls the script in the MODEL.

    im trying now to combine the scripts i made to make it easier…

    thanks,
    maria

  • #8 / Jan 07, 2010 11:58pm

    jmadsen

    438 posts

    you may be right, but I think it goes beyond dashes. I just ran into it a day or two ago, but can’t think what I was doing, other than it was a new CI setup that was otherwise pretty normal.

    wish I weren’t getting so darn old so I could remember :-(

  • #9 / Jan 08, 2010 12:15am

    WebsiteDuck

    93 posts

    @jmadsen, You’re right, it’s not just dashes,  so you might try the fix on that blog post if you’re still getting the disallowed characters error

  • #10 / Jan 08, 2010 1:21am

    maria clara

    315 posts

    @jmadsen, You’re right, it’s not just dashes,  so you might try the fix on that blog post if you’re still getting the disallowed characters error

    im not now getting the disallowed characters when i removed the “”. but now i got a “page not found” error in my console..

  • #11 / Jan 08, 2010 2:44am

    jmbatty

    9 posts

    this probably has nothing to do with it, but you have a typo here

    ,{name : 'company_access_id', index: 'comapny_access_id',hidden:true}
  • #12 / Jan 08, 2010 2:55am

    maria clara

    315 posts

    this probably has nothing to do with it, but you have a typo here

    ,{name : 'company_access_id', index: 'comapny_access_id',hidden:true}

    i already had fixed that typo.
    here:

    ,{name : 'company_access_id', index: 'company_access_id', hidden:true}

    but still my console shows this error:

    <h1>404 Page Not Found</h1>
            The page you requested was not found.

    thanks,
    maria

  • #13 / Jan 08, 2010 12:39pm

    hollow

    5 posts

    Hello,

    I also met this problem, with CI and jqGrid. My problem is when I use the dataUrl option for the select input, in the form editing mode.

    editoptions: {dataUrl:"note/get_students_in_class"}

    “get_students_in_class” is a method in the controller “note” which returns the select input as html. This method is called using a GET request (http://www.domain.com/note/get_students_in_class?_nsd=123214325) and jqGrid adds a parameter to it.

    Very odd, as I was writing this post, where I was going to say that for 2 days I’ve been getting disallowed characters URI 400 and 404s, I changed the .htaccess file on the server (forgot to say that it worked for me locally, but not on the server) and everything seems to be ok now.

    Here’s my .htaccess now, may be that’s the cause:

    <IfModule mod_rewrite.c>
        RewriteEngine On
        RewriteCond %{REQUEST_FILENAME} !-f
        RewriteCond %{REQUEST_FILENAME} !-d
        RewriteRule ^(.*)$ index.php?/$1 [L]
    </IfModule>

    Good luck!

  • #14 / Jan 08, 2010 2:01pm

    WebsiteDuck

    93 posts

    If you’re using rewrite in your .htaccess file and your GET parameters aren’t coming through, try this:

    <IfModule mod_rewrite.c>
        RewriteEngine On
        RewriteCond %{REQUEST_FILENAME} !-f
        RewriteCond %{REQUEST_FILENAME} !-d
        RewriteRule ^(.*)$ index.php/$1 [L,QSA]
    </IfModule>

    QSA is query string append

  • #15 / Jan 08, 2010 3:23pm

    hollow

    5 posts

    My previous .htaccess had the QSA option set and it gave the error with the disallowed URI characters. Actually, only the jqGrid uses in this case a GET request and I don’t need the parameters, so it’s ok for me like that.

    Thank you!

.(JavaScript must be enabled to view this email address)

ExpressionEngine News!

#eecms, #events, #releases