small change to allow onSubmit pass strict validation, fixes #4311

git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@6961 3807eeeb-6ff5-0310-8944-8be069107fe0
This commit is contained in:
DarkAngelBGE 2008-05-19 08:06:58 +00:00
parent 0db9a4ca00
commit 5047963a77

View file

@ -195,10 +195,10 @@ class FormHelper extends AppHelper {
unset($options['type'], $options['action']);
if ($options['default'] == false) {
if (isset($htmlAttributes['onSubmit'])) {
$htmlAttributes['onSubmit'] .= ' event.returnValue = false; return false;';
if (isset($htmlAttributes['onSubmit']) || isset($htmlAttributes['onsubmit'])) {
$htmlAttributes['onsubmit'] .= ' event.returnValue = false; return false;';
} else {
$htmlAttributes['onSubmit'] = 'event.returnValue = false; return false;';
$htmlAttributes['onsubmit'] = 'event.returnValue = false; return false;';
}
}
unset($options['default']);