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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T02:26:06+00:00 2026-06-08T02:26:06+00:00

Usually with PHP and editing you click on a link that goes to a

  • 0

Usually with PHP and editing you click on a link that goes to a separate PHP page that has the “ID” of the entry you want to edit, you get the ID and populate your form base on this.

I would like to know how to do this if I am using a modal form? How do I get the ID get the records associated with it then populate the modal form.

sort of like this

//dropdown behavior for resp task and sub_task
$('#r_task_id').change(function() {
    var selected_task_id = $('#r_task_id').val();
    $.post("Assignment/populateSubTaskDropDown", { 'selected_task_id' : selected_task_id },//$_POST['selected_task_id']
             function(data){                
            $('#r_sub_task_id').empty();
            $.each(data, function(val, text) {
                $('#r_sub_task_id').append(
                    $('<option></option>').val(val).html(text)
                );
     });}, "json");

});//task

PHP code is:

$this->session->set_userdata('selected_sub_task_id', $this->input->post('selected_sub_task_id'));
    $json_resp_user = $this->assignmentModel->getResponsibleUsers($this->session->userdata('selected_sub_task_id'));

    $json = array();
    $json[0] = "-Select-";

    if( count($json_resp_user) >= 1 ){ //if there is more in the result than the -Select-
        foreach($json_resp_user as $detail){
            //$json[$detail->user_id] = $detail->first_name." ".$detail->middle_name." ".$detail->last_name;
            $json[$detail->user_id] = $detail->first_name." ".$detail->last_name;
        }
    }
    echo json_encode($json);

but for the whole form not just a dropdown.

  • 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-08T02:26:08+00:00Added an answer on June 8, 2026 at 2:26 am

    I had a quick read of $.post() of jQuery and apparently that was what I meant =p

    the part on your script with

    id =” //Set this when opening the modal window

    was where I was stuck on how to read that.

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

    sorry if I wasn’t clear but thank you for taking the time and trouble to answer me.

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

Sidebar

Related Questions

Usually I have the main page (index.php) that include header/footer/menu and the content of
Usually I'd add a for each loop for a mysql database entry in PHP,
I have a page called Error.php. Variables are usually passed to it using the
I have a URL that would be like so: http://mysite.com/index.php?somename=somevalue I usually check that
i just create reading file feature. In general, what kind PHP class that usually
So I know that to install a PHP librabry usually you install it in
I know that PHP CLI is usually used because of none time limits and
Usually a PHP application has an user interface. In a MVC layered application you
From within my buddypress PHP templates I usually get the username of any given
I usually use this code below to include the page that I need into

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.