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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T16:22:43+00:00 2026-06-10T16:22:43+00:00

So I am attempting for my first time to use CI’s built in form_validation

  • 0

So I am attempting for my first time to use CI’s built in form_validation “tool” to much avail and research I can’t seem to grasp it. I have everything in my view setup correctly and my controller seems to be right on… My problem is when I click the “submit” button it links to the new function but doesn’t display any error messages regardless of what I put in the “name” , “email” boxes. I’m looking to have it display an error message practically anywhere right now I just need it to run through the validation and display an error message.

Controller file

public function intelli()
{
    $data["messages"] = "";
    $this->load->view('engage_header');
    $this->load->view('engage_nav');
    $this->load->view('intelli/content_intelli', $data);
    $this->load->view('engage_footer');

}
public function intelli_email()
{
    $this->load->helper('form', 'url'));
    $this->load->library('form_validation');

    $this->form_validation->set_rules('name_area', 'Name', 'required|alpha|xss_clean');
    $this->form_validation->set_rules('email_area', 'Email', 'required|valid_email|xss_clean');
    $this->form_validation->set_rules('phone_area', 'Phone', 'is_numeric|xss_clean');

    if ($this->form_validation->run() == FALSE) {
        $data["messages"] = "";
    } else {

        $data["messages"] = "The Email has successfully been sent";
    }

    $this->load->view('engage_header');
    $this->load->view('engage_nav');
    $this->load->view('intelli/content_intelli', $data);
    $this->load->view('engage_footer');
}

View file

<?php 
    $this->load->helper("form");
?>
<div class="request_demo">
    <div id="request_logo"></div>
    <div id="top_paragraph">
    Intelliship & HALO deliver immediate and quantifiable ROI.  Schedule a demo to learn how this transportation management software will positively impact your company&apos;s bottom-line profit.
    </div>
    <div id="entry_box">
    <?php  echo validation_errors();
    echo $messages;
    ?>
    <div id="request_form">
    <?php echo form_open('/index.php/site/intelli_email')?>
            <input id="name_area" type="text" placeholder="NAME" value="" required/><br/>
            <input id="email_area" type="text" placeholder="EMAIL" value="" required/><br/>
            <input id="phone_area" type="text" placeholder="PHONE" value=""><br/>
            <input id="submit_req" type="submit" value="SUBMIT">
        </form> 
    </div>
</div>

I know the code is sloppy right now, but I’m just looking for functionality over beauty. also noted since I am loading the helper(‘form’) inside the controller it is redundant to load it in the view.

  • 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-10T16:22:45+00:00Added an answer on June 10, 2026 at 4:22 pm

    You have only specified id for your form elements. Give them name as well

    <input id="name_area" name ="name_area" type="text" placeholder="NAME" value="" required/><br/>
    <input id="email_area" name="email_area" type="text" placeholder="EMAIL" value="" required/><br/>
    <input id="phone_area" name="phone_area" type="text" placeholder="PHONE" value=""><br/>
    

    Codeigniter hooks up the rule sets, with elements based on name, not id

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

Sidebar

Related Questions

I'm attempting to use fabric for the first time and I really like it
I am attempting to use the remote data annotation for the first time in
I'm attempting to use Core Foundation for the first time and I must be
I'm attempting to use Doctrine ORM for the first time, and I'm following the
This is my first time attempting to use Windows Installer to build a setup
I am attempting to use Cloud9 IDE for the first time, and start a
I'm attempting to edit the registry with C++ and this is my first time
First off i want to say im attempting (and mostly succeeding) to use purely
I am attempting to write my first Dynamics Crm 2011 plugin. I have therefore
I have sort of a tricky problem I'm attempting to solve. First of all,

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.