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 7819847
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T07:05:28+00:00 2026-06-02T07:05:28+00:00

I’m trying to figure out why my form validation run function is returning false.

  • 0

I’m trying to figure out why my form validation run function is returning false. According to the docs it says the following:

The run() function only returns TRUE if it has successfully applied your rules without any of them failing.

Here’s what my rules look like:

$this->form_validation->set_rules('nicknames', 'Nicknames',
        'required');
    $this->form_validation->set_rules('hometown', 'Hometown',
        'required');
    $this->form_validation->set_rules('height', 'Height',
        'required');
    $this->form_validation->set_rules('Weight', 'Weight',
        'required');
    $this->form_validation->set_rules('manager', 'Manager',
        'required|integer');   
    $this->form_validation->set_rules('setup', 'Setup',
        'required');
    $this->form_validation->set_rules('finisher', 'Finisher',
        'required');
    $this->form_validation->set_rules('biography', 'Biography',
        'required');   

Here’s what the post submission runs:

biography   Kid coming out of college getting the chance of a lifetime.
finisher    Idolizer
height  5'4"
hometown    Las Vegas, Nevada
manager 0
nicknames   "The Quintessential Cruiserweight of KOW!"; "K-Dub"
setup   That's Wondeful
submit  Submit
weight  140 lbs.

http://pastebin.com/F9XeEibf

function biographySubmit()
{
    $outputArray = array('error' => 'yes', 'message' => 'unproccessed');
    $outputMsg = '';
    // Sets validation rules for the login form
    $this->form_validation->set_rules('nicknames', 'Nicknames',
        'required');
    $this->form_validation->set_rules('hometown', 'Hometown',
        'required');
    $this->form_validation->set_rules('height', 'Height',
        'required');
    $this->form_validation->set_rules('Weight', 'Weight',
        'required');
    $this->form_validation->set_rules('manager', 'Manager',
        'required|integer');   
    $this->form_validation->set_rules('setup', 'Setup',
        'required');
    $this->form_validation->set_rules('finisher', 'Finisher',
        'required');
    $this->form_validation->set_rules('biography', 'Biography',
        'required');   

    // Checks to see if login form was submitted properly(
    if (!$this->form_validation->run())
    {
        $outputArray['message'] =
            'There was a problem submitting the form! Please refresh the window and try again!';
    }
    else
    {
        $bioFields = array($this->input->post('nicknames'), $this->input->post('hometown'), $this->input->post('height'), $this->input->post('weight'), $this->input->post('manager'), $this->input->post('setup'), $this->input->post('finisher'), $this->input->post('biography'));          
        if ($this->bios->updateBiography($bioFields, $this->session->userdata('defaultRosterListID')))
        {
            $outputArray = array('success' => 'Yes', 'message' =>
                                        'Biography were updated successfully!');
        }
        else
        {
            $outputArray['message'] =
            'The biopgraphy was not able to be updated in the database. Please try again later!';
        }
    }
    echo json_encode($outputArray);
}

jQuery Code:

var validateform = $("#biographyForm").validate({
    invalidHandler: function(form, validator) {
        var errors = validator.numberOfInvalids();
        if (errors) {
            var message = errors == 1
            ? 'You missed 1 field. It has been highlighted.'
            : 'You missed ' + errors + ' fields. They have been highlighted.';
            $('.box #biographyForm .content').removeAlertBoxes();
            $('.box #biographyForm .content').alertBox(message, {type: 'warning', icon: true, noMargin: false});
            $('.box #biographyForm .content .alert').css({
                margin: '0',
                borderLeft: 'none',
                borderRight: 'none',
                borderRadius: 0
            }).delay( 3000 ).fadeOut( 'slow' );
        } else {
            $('.box #biographyForm .content').removeAlertBoxes();
        }
    },
    ignore : 'input:hidden:not(:checkbox):not(:radio)',
    showErrors : function(errorMap, errorList) {
                    this.defaultShowErrors();
                    var self = this;
                    $.each(errorList, function() {
                        var $input = $(this.element);
                        var $label = $input.parent().find('label.error').hide();
                        if (!$label.length) {
                            $label = $input.parent().parent().find('label.error');
                        }
                        if($input.is(':not(:checkbox):not(:radio):not(select):not([type=file])')) {
                            $label.addClass('red');
                            $label.css('width', '');
                            $input.trigger('labeled');
                        }
                        $label.fadeIn();
                    });
                },
    errorPlacement : function(error, element) {
                    if(element.is(':not(:checkbox):not(:radio):not(select):not([type=file])')) {
                        error.insertAfter(element);
                    } else if(element.is('select')) {
                        error.appendTo(element.parent());
                    } else if (element.is('[type=file]')){
                        error.insertAfter(element.parent());
                    } else {
                        error.appendTo(element.parent().parent());
                    }

                    if ($.browser.msie) {
                        error.wrap('<div class="error-wrap" />');
                    }
                },
    submitHandler: function(form) {
        var dataString = $('#biographyForm').serialize();
        $.ajax({
            type: 'POST',
            url: 'biography/biographySubmit',
            data: dataString,
            dataType: 'json',
            success:  function(data) {
                if (data.error) {
                    $('.box #biographyForm .content').removeAlertBoxes();
                    $('.box #biographyForm .content').alertBox(data.message, {type: 'warning', icon: true, noMargin: false});
                    $('.box #biographyForm .content .alert').css({
                        width: '',
                        margin: '0',
                        borderLeft: 'none',
                        borderRight: 'none',
                        borderRadius: 0
                    }).delay( 3000 ).fadeOut( 'slow' );
                }
                else
                {
                    $('.box #biographyForm .content').removeAlertBoxes();
                    $('.box #biographyForm .content').alertBox(data.message, {type: 'success', icon: true, noMargin: false});
                    $('.box #biographyForm .content .alert').css({
                        width: '',
                        margin: '0',
                        borderLeft: 'none',
                        borderRight: 'none',
                        borderRadius: 0
                    }).delay( 3000 ).fadeOut( 'slow' );   
                }
            }
        });
    }
});
  • 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-02T07:05:30+00:00Added an answer on June 2, 2026 at 7:05 am

    I’m not sure if this will totally fix your problem but your form doesn’t seem to have an action. It should be something like action="[your site url]/your_controller_name/biographySubmit".

    You could use CodeIgniter’s URL Helper and use this: action="<?php echo site_url("your_controller_name/biographySubmit"); ?>"

    Without an action, the data in the form won’t be passed to the biographySubmit function within your controller.

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

Sidebar

Related Questions

I'm trying to decode HTML entries from here NYTimes.com and I cannot figure out
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I'm new to using the Perl treebuilder module for HTML parsing and can't figure
I am trying to understand how to use SyndicationItem to display feed which is
Basically, what I'm trying to create is a page of div tags, each has
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I am trying to render a haml file in a javascript response like so:
I want use html5's new tag to play a wav file (currently only supported
I'm using v2.0 of ClassTextile.php, with the following call: $testimonial_text = $textile->TextileRestricted($_POST['testimonial']); ... and
I would like to run a str_replace or preg_replace which looks for certain words

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.