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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T10:09:50+00:00 2026-05-18T10:09:50+00:00

I have been stuck on this problem for days and am about the crack…

  • 0

I have been stuck on this problem for days and am about the crack… I have no idea what I’m doing wrong or where I should look for help.

I have a search page that allows users to filter the results by a number of categories.

This is the view:

<form method="post" id="search_form" name="search_form">
 <input type='hidden' id='seeking_gender_id' value='<?php echo $profile->gender_id ?>'/>

 <div id='sidebar_wrapper'>
  <div id='sidebar'>
   <div class="slider_header">
    Country
   </div>
   <div class="slider_content">
    <select id="country_dropdown" name="country_dropdown">
    <?php
     if($countries->num_rows() > 0)
     {
      foreach($countries->result() as $row)
      {
       $selected = ($row->country_id == $profile->country_id ? "selected='yes'" : "");
       echo "<option value='" . $row->country_id . "' "  . $selected . ">" . $row->country ."</option>";
      }
     }
    ?>
    </select>
   </div>
   <div class="slider_header">
    Region
   </div>
   <div class="slider_content">
    <select id='region_dropdown' name='region_dropdown'>
     <option value="0">All regions</option>
     <?php
      if($regions->num_rows() > 0)
      {
       foreach($regions->result() as $row)
       {
        $selected = ($row->region_id == $profile->region_id ? "selected='yes'" : "");
        echo "<option value='" . $row->region_id . "' "  . $selected . ">" . $row->region ."</option>";
       }
      }
     ?>
    </select>
   </div>
   <div class="slider_header">
    Gender
   </div>
   <div class="slider_content">
    <?php
     $male_checked = ($profile->seeking_gender_id == 1 ? "checked='yes'" : "");
     $female_checked = ($profile->seeking_gender_id == 2 ? "checked='yes'" : "");
    ?>
    <input id='male_checkbox' type="checkbox" name="genders" <?php echo $male_checked ?> value="1" />
    Male
    <br/>
    <input id='female_checkbox' type="checkbox" name="genders" <?php echo $female_checked ?>  value="2" />
    Female
   </div>
   <div class="slider_header">
    Age
   </div>
   <div class="slider_content">
    Between 
    <input id="min_age" type="text" maxlength="2" style="width: 35px" value='<?php echo $profile->min_age ?>'/>
    and
    <input id="max_age" type="text" maxlength="2" style="width: 35px" value='<?php echo $profile->max_age ?>'/>
   </div>
   <input id='profile_search_button' type='button' value='Search'></input>
  </div>
  <div id='sidebar_content'>
   <div id='content_header'>
    Search
    <div id='profiles_found' style='float: right'>0</div>
   </div>
   <div id='search_results'></div>
  </div>
  <div id='sidebar_footer'></div>
 </div>
</form>

So when the “profile_search_button” is clicked, the following jQuery code is run:

    $("#profile_search_button").click(function()
 {
  $('#search_results').hide();

  $.post("http://localhost/index.php/search/search_database",
  function(data)
  { $('#search_results').html(data);
   $('#search_results').slideDown('slow');
  });
 });

That function calls the following PHP function:

public function search_database()
{
// HOW AM I MEANT TO GET THE VALUES OF THE FORM FILTERS? eg: country_id, region_id etc

$this->load->library('Jquery_pagination');

$config['base_url'] = site_url('search/blahh/');
$config['total_rows'] = 100;
$config['per_page'] = '10';
$config['div'] = '#search_results';

$this->jquery_pagination->initialize($config);
echo $this->jquery_pagination->create_links();
}

The code above works… I just have no idea how to read the values of the filters from the “search_database” PHP function.

I have been working off this example, but that’s all I can seem to find:

http://tohin.wordpress.com/2008/10/07/codeigniter-ajax-pagination-exampleguideline/

Anyone able to help?

  • 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-05-18T10:09:51+00:00Added an answer on May 18, 2026 at 10:09 am

    Use the ‘data’ section of $.post.

    http://api.jquery.com/jQuery.post/

    $.ajax({
      type: 'POST',
      url: url,
      data: { $('#form_field').val() },
      etc.
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have been stuck on this problem for almost 2 days now, consider the
Hope to get solution to this problem. I have been stuck on it since
I have been stuck on this for days, and was wondering if anyone had
I've been stuck with this for weeks now and have no idea where I'm
im new to iphone sdk programming, and have been stuck on this problem for
i'm now stuck on this problem for days and i haven't been able to
I have been stuck on this for a few days and I would ping
I'm new to android and have been stuck on this problem for a long
I've been stuck with this problem from a couple of days and I can't
Have been stuck with this issue for a few days now, and really need,

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.