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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T17:04:04+00:00 2026-06-16T17:04:04+00:00

I’m using Codeigniter framework to create my web application. I have a login form

  • 0

I’m using Codeigniter framework to create my web application.

I have a login form for the users to input their username and password as well as a remember me checkbox. After the user submits the form it uses jQuery ajax to submit the form and send the post data to the login controller submit function for data checking and manipulation. After the submit function is ran a JSON array is returned if the user was logged in. If the user is successfully logged in he/she is sent to the dashboard and if they weren’t logged in successfully then an error message is displayed for the user to let them know something went wrong.

What I would like is for the validation rules that do not pass on the php side for them to display under the corresponding input fields just like it does on the jQuery form validation. I’m running both validations just in case something eludes me jQuery side and PHP catches it and fixes the problem.

As of right now it displays a message saying it didn’t pass validation but I’m having an issue with figuring out how to display the validation rule that didn’t pass under the user input box.

This is the JSON returned message from php as of right now. So right now its saying that there was an error and that it lets the user know the form didn’t validation and includes the error messages that are the reason why it didn’t validate.

{"output_status":"Error","output_title":"Form Not Validated","output_message":"The form did not validate successfully!","error_messages":{"username":"This is not have an accepted value!"}}

<div style="display:none"  id="message_container"><button type="button" class="close" data-dismiss="alert">&times;</button></div>
<div class="login_container">
<?php $attributes = array('id' => 'login_form', 'class' => 'form-horizontal'); ?>
<?php echo form_open('login/submit', $attributes); ?>
<div class="form-row row-fluid">
    <div class="spa12">
        <div class="row-fluid">
            <?php $attributes = array('class' => 'form_label span12'); ?>
            <?php echo form_label('Username<span class="icon16 icomoon-icon-user-3 right gray marginR10"></span>', 'username', $attributes); ?>
            <?php $attributes = array('name' => 'username', 'id' => 'username', 'value' => '', 'class' => 'span12 text valid'); ?>
            <?php echo form_input($attributes); ?>
        </div>
    </div>
</div>
<div class="form-row row-fluid">
    <div class="span12">
        <div class="row-fluid">
            <?php $attributes = array('class' => 'form_label span12'); ?>
            <?php echo form_label('Password<span class="icon16 icomoon-icon-locked right gray marginR10"></span><span class="forgot"><a href="#">Forgot your password?</a></span>', 'password', $attributes); ?>
            <?php $attributes = array('name' => 'password', 'id' => 'password', 'value' => '', 'class' => 'span12 password'); ?>
            <?php echo form_password($attributes); ?>
        </div>
    </div>
</div>
<div class="form-row row-fluid">                       
    <div class="span12">
        <div class="row-fluid">
            <div class="form-actions">
                <div class="span12 controls">
                    <input type="checkbox" id="keepLoged" value="Value" class="styled" name="logged" />Keep me logged in
                    <button type="submit" class="btn btn-info right" id="loginBtn">
                        <span class="icon16 icomoon-icon-enter white"></span>
                        Login
                    </button>
                </div>
            </div>
        </div>
    </div> 
</div>
</form>
</div>
  • 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-16T17:04:05+00:00Added an answer on June 16, 2026 at 5:04 pm

    you could do this. On the php side wherever validation fails return the error message along with the field name
    then use the field name to select in jQuery and append the error message

    $(fieldname).append(<span>error</span>);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

That's pretty much it. I'm using Nokogiri to scrape a web page what has
I have a text area in my form which accepts all possible characters from
I have thousands of HTML files to process using Groovy/Java and I need to
public static bool CheckLogin(string Username, string Password, bool AutoLogin) { bool LoginSuccessful; // Trim
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I have a .ini file as follows: [playlist] numberofentries=2 File1=http://87.230.82.17:80 Title1=(#1 - 365/1400) Example
I am using JSon response to parse title,date content and thumbnail images and place
I'm new to using the Perl treebuilder module for HTML parsing and can't figure
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I am trying to find ID3V2 tags from MP3 file using jid3lib in Java.

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.