Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8901331
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T01:19:29+00:00 2026-06-15T01:19:29+00:00

I have an issue working with codeigniter uri language identifier and form_validation. The problem

  • 0

I have an issue working with codeigniter uri language identifier and form_validation.

The problem is form_validation stops working when I set $config[‘lang_ignore’] to FALSE.
I have tested in a clean codeigniter installation and setup uri language identifier as said in codeigniter’s wiki.

Here’s my controller application/controllers/form_validation_test.php:

<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');

class Form_validation_test extends CI_Controller {

public function __construct()
{
    parent::__construct();
}

public function index()
{   
    $this->load->view('form_validation_test_view');
}



//Get Ajax POST:
public function getPost()
{
    $result = FALSE;
    $data = NULL;

    $this->load->library('form_validation');

    $this->form_validation->set_rules('user','User','required');

    $result = $this->form_validation->run();

    $response = array(
        'result' => $result
    );

    $this->output->set_content_type('application/json')
            ->set_output(json_encode($response));
}
}

View application/views/form_validation_view.php:

<script src="http://ci_test.localhost/js/jquery-1.8.2.min.js" type="text/javascript"></script>
<script type="text/javascript" src="http://ci_test.localhost/js/ci_test.js"></script>

<form name="formulario" id="formulario" action="http://ci_test.localhost/form_validation_test/getPost">
    <input type="text" id="user" name="user" value="">
</form>

<input type="button" id="btnSubmit" value="submit">

<div id="result"></div>

and Javascript file js/ci_test.js:

jQuery(document).ready(function(){

jQuery('#btnSubmit').click(function(){

    var postData    = jQuery('#formulario').serialize();
    var targetUrl   = jQuery('#formulario').attr('action');     

    jQuery.ajax({
        url:        targetUrl,
        data:       postData,
        type:       'post',
        dataType:   'json', 

        success:    function (data, textStatus, jqXHR) {
            res = data.result ? 'TRUE':'FALSE';
            jQuery('#result').html(res);

        }

    });
});
});

So as you can see I send post through ajax request, just get the result and place it in div. If you set ‘lang_ignore’ to TRUE it works, but not if you set it to FALSE.

Another behavior I have observed is that when everythig works fine, you see the POST request in firebug but when using lang_ignore as FALSE you can see the POST request and a GET request that remains loading. I have no idea about why this happens but maybe can help someone find the problem.

Any help would be appreciated.
Thanks all for your time.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-15T01:19:30+00:00Added an answer on June 15, 2026 at 1:19 am

    I found the solution.

    If you set lang_ignore parameter to FALSE, the constructor in application/core/MY_lang.php file does one redirection and (correct me if I’m wrong) you lose the POST.

    So including language segment goes straight in one single request.

    http://ci_test.localhost/en/form_validation_test/getPost
    

    It worked for me, hope can help someone

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

My problem/issue We are working on an opensource project which we have hosted on
I have issue to set all controls values by button click to default. Problem
I am using codeigniter 1.7.3 and I have controllers set up and working, but
I have an issue working with Microsoft.Build.BuildEngine which supposed to get fixed modifing my
I am working on an application an have an issue about running shell command
I am working with Ruby every day, but i have an issue in Python.
I have a strange issue . I am currently working on a mail app
Working with Reporting Services 2008 r2. So here's my issue: We have 5 reports
I have been working on a json decode issue (which I have already had
The Issue: when multiple users have access to the same working directory, permissions issues

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.