I thought I'd ask as I've only really done web pages with ASP .Net and
coming back to PHP is hard work after the luxuries of ASP .Net . (IMHO)

I've hit a bit of stumbling block when it comes to postbacks, or just
plain re-posts if you're from PHP.

What's the best way to keep your controls in sync in page refresh?  ie
dropdowns or other controls not populated directly from the model.

Does it really have to be a manual process each time to set the
controls up again?
eg:
===== part of my controller =====
                        // If form posted due to month change.
                        $dateSelected='';
                        if ($isPostBack) {
                                // Get value.
                                $dateSelected =
$this->params['form']['data']['User']['firstMonthDate'];

                        }
                        // This will set the dropdown at selected value.
                        $this->set('dateSelected',$dateSelected);
===========================

Then inside the view I do:

============= view =============
echo $html->selectTag('User/firstMonthDate',
$months,$dateSelected,$selectAttr=array("onchange" =>
"document.form1.submit();") ,null,false);
=================


Am I doing things ar$e about or are things really this tedious all the
time?

Pat.

ps. don't take this as a PHP bash as I'm not web programmer by trade.
Normally unix/oracle/perl until had to do web pages with .Net


--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to