Commit fc1931e5 authored by Carsten  Rose's avatar Carsten Rose
Browse files

HelperFormElement.php: migrate to use validator.js function to do 'match' comparison

parent 12cdab3a
......@@ -384,6 +384,8 @@ abstract class AbstractBuildForm {
$this->fillWrapLabelInputNote($label, $input, $note);
}
//TODO: hier den Defaultvalue fuer RETYPE Elemente bestimmen.
// Get default value
$value = ($formElement[FE_VALUE] === '') ? $this->store->getVar($formElement['name'], $storeUse,
$formElement['checkType']) : $formElement[FE_VALUE];
......@@ -666,9 +668,14 @@ abstract class AbstractBuildForm {
$attribute = Support::doAttribute('name', $htmlFormElementId);
$attribute .= Support::doAttribute('class', 'form-control');
if (isset($formElement[FE_RETYPE]) && $formElement[FE_RETYPE] == '1') {
$htmlFormElementIdRetype = str_replace($formElement[FE_NAME], $formElement[FE_NAME] . RETYPE_FE_NAME_EXTENSION, $htmlFormElementId);
$attribute .= Support::doAttribute('data-compare-element', $htmlFormElementIdRetype);
// if (isset($formElement[FE_RETYPE]) && $formElement[FE_RETYPE] == '1') {
// $htmlFormElementIdRetype = str_replace($formElement[FE_NAME], $formElement[FE_NAME] . RETYPE_FE_NAME_EXTENSION, $htmlFormElementId);
// $attribute .= Support::doAttribute('data-compare-element', $htmlFormElementIdRetype);
// }
if (substr($formElement[FE_NAME], -6) == RETYPE_FE_NAME_EXTENSION) {
$htmlFormElementIdPrimary = str_replace(RETYPE_FE_NAME_EXTENSION, '', $htmlFormElementId);
$attribute .= Support::doAttribute('data-match', '[name=' . str_replace(':', '\\:', $htmlFormElementIdPrimary) . ']');
}
// Check for input type 'textarea'
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment