Thursday, January 29, 2009

Validation of a disabled input field

Hi,

is there a way to activate the validation of a disabled input field?

In my view I have a field like this:

<?php echo $form->input('templatefile', array('label' => 'Template',
'disabled'=>TRUE)); ?>

The input field is disabled for the user but gets written to via
Javascript. I would like to apply the "notEmpty" rule to this field,
so that there is an error shown, if the form is submitted and the
field is empty.

Only problem: disabled=>TRUE automatically stops validation as well.

Cheers,
tobi_one
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to cake-php+unsubscribe@googlegroups.com
For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---

No comments: