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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T06:41:37+00:00 2026-05-30T06:41:37+00:00

Experimenting with JsHelper in CakePHP 2.0, I got a Request method to update the

  • 0

Experimenting with JsHelper in CakePHP 2.0, I got a Request method to update the value of a form field with the results of an AJAX call – so far, so good. However, on inspecting the form field it says:

<input type="hidden" id="JobsPartUnitcost" name="data[JobsPart][unitcost]">5.55</input>

but when I copied it and first pasted it above it said

<input type="hidden" id="JobsPartUnitcost" name="data[JobsPart][unitcost]"></input>

and when I submitted the form the value was empty. Why is the browser showing the value but the underlying DOM not registering it?

Using Mac/Safari, CakePHP 2.0, JQuery

EDIT
As requested here is form data dump

    Array ( [JobsPart] => Array ( [job_id] => 1 [company_id] => 4 [part_id] => 2 [qty] => 3 [unitcost] => ) )

and here is AJAX code

$this->Js->get('#JobsPartPartId')->event('change',
    $this->Js->request(
        array(
            'controller'=>'JobsParts',
            'action'=>'getPart'
        ),
        array(
            'update'=>'#JobsPartUnitcost',
            'async' => true,
            'method' => 'post',
            'dataExpression'=>true,
            'data'=> $this->Js->serializeForm(array(
                'isForm' => false,
                'inline' => true
            ))
        )
    )
);
  • 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-30T06:41:38+00:00Added an answer on May 30, 2026 at 6:41 am

    OK. I have found a workaround and no one else seems to have found a direct solution.

    In my static view I now have just <td id="part"></td> where the input field was. My Ajax call now updates ‘#part‘ and my dynamic view (the one called by the controller ajax action) now outputs the whole field – <?php echo $this->Form->input('unitcost', array('type' => 'text', 'value' => $part['Part']['costamount'])); ?>. Ugly but it works.

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

Sidebar

Related Questions

I've been experimenting with QUnit tests and was looking for a good method to
While experimenting with some stuff on the REPL, I got to a point where
experimenting with Visitor pattern and generic method I found a kind of discrepancy in
While experimenting with the C++11 std::scoped_allocator_adaptor as implemented in gcc 4.7.0 so far, I
Experimenting with Scala... I'm trying to define something analogous to the @ hack in
While experimenting with this question on collections in Spring.NET , I discovered that Spring
While experimenting with pixel shaders in WPF I decided to draw some pixels onto
When experimenting with (embedded) Apache Derby DB, I noticed that a fresh database, with
I experimenting with twitter streaming API, I use Phirehose to connect to twitter and
I have been experimenting with woopra.com A web analytics tool. Which requires a piece

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.