Using Ajax with cakephp

HI I am new to cakephp so any help would be grateful. I have created a form and with one of the fields when the user has filled in checks to see it it already exists and offers other suggestions. I have used the Ajax observerField method to do this. I want the user to be able to click on the suggested names(radioboxes) and then it update the field in the other form. What is the best way to achieve this in cakephp?

Answers


If it was me, I would create a form field

echo $form->input('otherfield');

Then use javascript to catch the click on the suggested radio, and copy the value into that field.

In jQuery,

$('#suggestions input[type=radio]').click(function(){
  $('#otherfield').val() = $(this).val();
});

Then when the form is submitted you will have it in,

$this->data['Model']['otherfield']

Need Your Help

dashed line in ggplot legend

r ggplot2 legend

I want to set the linetype of my legend.

Meteor - Create Polls - Database Update

jquery mongodb meteor

I am using Meteor to create a web app that allows users to create and vote on polls.