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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T01:23:20+00:00 2026-05-26T01:23:20+00:00

Using CakePHP’s Ajax based observefield, I would like to update multiple fields, into my

  • 0

Using CakePHP’s Ajax based observefield, I would like to update multiple fields, into my form, any idea how can i achieve this?

If i try with 'update' => array('NoncompetitorEventId','NoncompetitorEventId') it doesn’t work even. It works for single field update, but not for multiple ones.

Kindly let me know if some patch is there. I’m using CakePHP 1.2 version.

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-05-26T01:23:21+00:00Added an answer on May 26, 2026 at 1:23 am

    You can do it with little tweak using the prototype along with observe field:

    Like:

    Step 1: Call your function using observe field and call protype function on complete as follow:

    echo $ajax->observeField('TransportorderContactId',array('url'=>'functionname','indicator' => 'loading_message','complete' => 'updateDetails(request,json)'));`
    

    Step 2: Set the required fields in json variable in your called function:

    echo json_encode(array('field1' => value1,'field2' => value2); //here keep your field name as id of the field you want to update.
    

    Step 3: Now you will get the above fields in your updateDetails function which is in add.ctp

     <script language="javascript">
       function updateDetails(request,json){
            var data = request.responseText.evalJSON();
            $H(data).each(function(pair){
              $(pair.key).setValue(pair.value);
            });
       }
     </script>
    

    And like this you can update more than one field using observe field.

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

Sidebar

Related Questions

I am using Cakephp and I would like to learn how to set a
i am trying to create a Radio button using Cakephp like the one the
Using CakePHP 1.3 there are named parameters in the URL like .../name:value/... These are
Using CakePHP, I created select-option form element with: echo $form->select('items', $numeration , array('selected' =>
I am using cakephp v1.26. I got a function in a controller like this:
So I using cakephp and using ajax to submit forms. In some cases it
Using cakephp: I am trying to update customer information and the address the customer
I'm using CakePHP for a small web app and on one form page there's
Using CakePHP's form helper to generate a checkbox is easy enough; to use the
Using CakePHP 1.3 we have a booking system for hotel rooms. A check-availability form

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.