Wizard Component Validation

Dave Maharaj :: WidePixels.com
2009-06-11T03:33:41+00:00


I am running into a problem validating the Wizard data before going to the
next step.
 
I have an Investor Controller (Investor controller contains the wizard)
where they are adding a Listing. The Listing its self HABTM tables but its
not validating them. 
I have validation set up and tested and it works for the other parts of the
site. The Listing thru the wizard steps allows the Investor to select
(checkbox) options from a HABTM table
 
Sure I know they are only checkboxes but my validation checks the submitted
value to be numeric and compares it against the values in the database so a
"bad" user can not edit the value with firebug and save junk to the db.
 
I even added debug($this->data); first thing in the validation function and
nothing so the data is not even getting to the Program table
 
I have 
var $uses = array('Investor', 'Program'); // testing validating the Program
first
 
also tried 
 
App::Import('Model', 'Program');
          $program = new program();
 
function -processPrograms()
      {    
    $this->Program->set($this->data);
// tried $this->Investor->Program->set($this->data);

          
          if ($this->Program->validates()) {
              return true;
          }
          return false;
      }
 
One thing I noticed was on the form its self where the Program checkboxes
show up the HTML rendered is 
 
<input id="ListingProgram2" type="checkbox" value="2"
name="data[Listing][Program][Program][]"/>
<label for="ListingProgram2">Commercial Investor Certification</label>
 
where normally it would be Program Program2
 
All the other fields validate...just not anything related to a HABTM.

Anyone have any ideas?
 
Dave


------------------------------------------
Loading


$ This page is proudly powered by www.pubbs.net, you can see more at cakephp archive | Partners: Global Manufacturers