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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T05:31:00+00:00 2026-05-20T05:31:00+00:00

I am trying to display contact information and allow edit in place. It is

  • 0

I am trying to display contact information and allow edit in place. It is not updating the field. Basically, the div I want to use has (e.g.) an address, I click on it, it highlight and then an edit box appears, I edit, click ok, and the thing updates as success. Yet the data has not updated, which I can tell when I check the record.

Here are snippets of relevant code:


CONTROLLER:

var $helpers = array ('Html','Form','Ajax','Javascript','Menu');
var $components = array( 'RequestHandler');
var $name = 'People';

…

function edit_in_place() {
 if (!empty($this->data)) {
  if ($this->Person->save($this->data)) {
    $thisId=$this->Person->id;
    $this->header("Content-Type: application/json");
    echo 'success';
    exit;
  } else {
    return 'Fail';
  }
 }
 $this->Autorender = FALSE;
 exit;
}

VIEW THAT TRIGGERS EDIT_IN_PLACE:

<div id="addresswork">
 <?php echo $person['Person']['addresswork'] ?>
</div>

<?php
 echo $ajax->editor(
   "addresswork", array( 
      'controller'=>'People',
      'action'=>'edit_in_place',
       $person['Person']['id'] 
 ),
    array('highlightcolor'=>'#aaeeff')
 )
?>

I have tried finding good documentation on this and failed. Any suggestions?

  • 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-20T05:31:01+00:00Added an answer on May 20, 2026 at 5:31 am

    I got it working — the problem was I wasn’t getting data into the function in the controller as I expected. So I did a print_r to figure out what params were coming back. Here’s what I did, although I’d be interested in any more comments on the correct way to do it:

    function edit_in_place() {
    
        if ($this->RequestHandler->isAjax())
        {
            $this->Person->id = $this->params['named']['id'];
            $field= $this->params['form']['editorId'];
            $value= $this->params['form']['value'];
    
            $this->Person->saveField($field,$value);
    
            Configure::write('debug', 0);
            echo $value;
            exit;
        }
    

    In the view that triggers this, I did this:

            <div id="addresswork">
            <?php echo $person['Person']['addresswork'] ?>
            </div>
            <?php
            echo $ajax->editor(
            "addresswork",
            array( 
                'controller'=>'People',
                'action'=>'edit_in_place',
                'id'=>$person['Person']['id']
                ),
            array(
                'submit'=>'OK',
                'style'=>'inherit',
                'submitdata' =>array('id'=>$person['Person']['id']),
                'tooltip'=>'Click this to edit',
                'highlightcolor'=>'#aaeeff')
            );
            ?>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am trying to display this section <tr> <div id=contact class=uniForm style=visibility: hidden; display:
I am trying to reuse the header layout for contact details display view. I
I'm trying to insert and update a piece of information on an existing contact
I'm trying to validate a contact form and I want to create some sort
I'm trying to generate the contact.php for a website, but it's not filling in
I 'm trying to read and display contacts from phone book in android. My
trying to display data only after variables have been set. $(document).ready(function () { function
Trying to display current time with PHP (using this ): $date = date('m/d/Y h:i:s
Im trying to display some files in a web page so the user can
I am trying to display data that I am getting from server through json.

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.