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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T18:24:19+00:00 2026-06-14T18:24:19+00:00

Based on the documentation , %s will be replaced by field name when setting

  • 0

Based on the documentation, %s will be replaced by field name when setting error messages.

If you include %s in your error string, it will be replaced with the
“human” name you used for your field when you set your rules.

Is there a way to have multiple %s in the string and define them differently?

  • 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-14T18:24:20+00:00Added an answer on June 14, 2026 at 6:24 pm

    This is the line in the form validation library that creates the error message:

    // Build the error message
    $message = sprintf($line, $this->_translate_fieldname($row['label']), $param);
    
    • $line: The error message template, for example “The % field is invalid”
    • $this->_translate_fieldname($row['label']): The field’s label
    • $param: The parameter passed the the validation function, if any, max_length[5] would pass “5”

    So that’s the extent of what the form validation class does for you. If you need more flexibility you’ll have to prepare the error message yourself <– might be useful beforehand with the extra variables already populated.

    It might be interesting to extend the form validation class via core/MY_form_validation.php and work this functionality in. Unfortunately this line is contained in the main function _execute which is very big and messy, and from looking at it now, you’d need to overload some other functions as well. I started to write an example but it actually looks like a chore. You might be better off using:

    $this->form_validation->set_message('rule_name', 'Your custom message here');
    

    More on setting error messages: http://ellislab.com/codeigniter/user_guide/libraries/form_validation.html#settingerrors

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

Sidebar

Related Questions

I set up my app's authentication system based on the Symfony2 security documentation .
I'm writing some documentation that will occasionally include C# or C++ code snippets. In
Based on documentation and articles it is recommended to call Abort() on a client
Our WinForms based application takes documentation files that were generated by Visual Studio (Xml
Is there a easy way to create documentation pages based on xml documentation in
I'm using MySQL API's function mysql_real_escape_string() Based on the documentation, it escapes the following
Based on the IE documentation on MSDN IE 8 supports up to 6 parallel
Documentation states: Files are included based on the file path given or, if none
February, 26 2010 21:34:00 Based on all the documentation I can find, MMMM, d
MSDN documentation indicates that threads started by the TPL will enjoy better scheduling. However,

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.