OK guys here's one to stump you:
My form is on a page where the bulk of the page is for tv listings, so
the URL for the page is like this: www.mydomain.com/listings/view/
At the top of the page is the main view of the listings, the main
feature of the page, but one we're not interested in for this problem.
At the bottom we have an editable form displaying a record from the
database for an individual TV show - completely unconnected to the
listings side of the site.
And this form is being displayed from an element tucked at the bottom
of the page, and is supposed to show the same as a user going to
mydomain.com/myshow/edit/5, for example, to edit record 5 in the
myshows table.
Here is the code I'm trying:
--------------
$user = $this->requestAction('mshows/edit/5');
echo $form->create('Myshow',
array('url'=>array('controller'=>'myshows', 'action'=>'edit')));
echo $form->input('title');
echo $form->input('rating');
echo $form->end('Submit')
-------------------------
Result? Well we get a nice array of info from the database, and we get
a nice form on the screen, but the <form> tag looks like this...
<form id="ListingsAddForm" method="post" action="/myshows/edit">
Spot the mistake? Not helpful. And the form is completely blank, no
fields populated. So what am I doing wrong? The fact that the form ID
seems to still think I'm interested in listings (presumably because of
the main URL I'm on), looks to me like a clue that it's being retarded
about something, but I can't figure out what. Am I failing to connect
the requestAction to the form somehow? If so what should I do?
Any suggestions?
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Cake
PHP" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---