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

  • Home
  • SEARCH
  • 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 8923509
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T07:08:31+00:00 2026-06-15T07:08:31+00:00

I have three select option list for month,day and year <?php echo form_dropdown(‘dob[month]’,$dates[‘months’],set_value(‘dob[month]’,’0′));?> <?php

  • 0

I have three select option list for month,day and year

<?php echo form_dropdown('dob[month]',$dates['months'],set_value('dob[month]','0'));?>
<?php echo form_dropdown('dob[day]',$dates['days'],set_value('dob[day]','0'));?>
<?php echo form_dropdown('dob[year]',$dates['years'],set_value('dob[year]','0'));?>

To validate if the entered date by the user is valid or not i am using the following rules:

$this->form_validation->set_rules('dob','date of birth','valid_dob'); 

Where valid_dob is a function defined in a My_form_validation class as follow :

public function valid_dob($dob)
{   
    if(checkdate($dob['month'],$day['day'],$day['year']))
    {
        return true;
    }
    return false;
}

But the function defined above is not executing by codeigniter,Please
let me know how can i validate a date using three drop down list.

Thanks.

  • 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-15T07:08:34+00:00Added an answer on June 15, 2026 at 7:08 am

    You need to callback your own validation function. Add callback_ before your function name

    $this->form_validation->set_rules('dob','date of birth','callback_valid_dob['.$this->input->post('dob').']');  // You can pass array to function for getting all three values month,day,year
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a select element. <select class='cSelectType'> <option value=1>one</option> <option value=2>two</option> <option value=3>three</option> <option
I have the following HTML markup:- <select name=List1 id=l1> <option>One</option> <option>Two</option> <option>Three</option> <option>Four</option> <option>Five</option>
I have a select list: <select id='myList'> <option value=>zero</option> <option value=1>one</option> <option value=2>two</option> <option
I have a list of three option values in a table. 'Approved' 'Pending' and
I have a select option, a list and a button. When the button is
I have two select list: <select id=one class=sel> <option id=1>1</option> <option id=2>2</option> <option id=3>3</option>
I have a select option list and im using jQuery Mobile. My list is
I have a group list as select like that: <select id=groups> <option value=g1>G1</option> <option
I have created a select list using PHP, and when clicking on it to
I have three select boxes state,city and locality with the id's same as name

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.