ui icon indicating copy to clipboard operation
ui copied to clipboard

Form error label is not dissapearing

Open romaninsh opened this issue 8 years ago • 10 comments

If form has an error, sometimes the error does not dissapear even after i change value and submit form again:

screen shot 2017-04-26 at 16 37 03

romaninsh avatar Apr 26 '17 15:04 romaninsh

This is observed on Calendar controls.

acicovic avatar Oct 15 '19 19:10 acicovic

Fomantic-UI calendar module prevent the input field from catching the regular change event we normally use for removing error prompt. Therefore manually setting onChange handler to remove error prompt is need here for Calendar field.

$date_time = $f->getField('date_time');
$date_time->setOption('onChange', new jsFunction([$f->js()->form('remove prompt', $date_time->short_name)]));

ibelar avatar Oct 15 '19 20:10 ibelar

Can this be implemented in Calendar field decorator class?

DarkSide666 avatar Oct 15 '19 20:10 DarkSide666

Can this be implemented in Calendar field decorator class?

It could but what if you need you own specific onChange handler?

ibelar avatar Oct 15 '19 20:10 ibelar

Yeah that's not good then.

DarkSide666 avatar Oct 16 '19 08:10 DarkSide666

any workarounds ever come around for this issue? I am not as savvy in JS at this integrated level - i cannot get the calendar workaround to work for FormField Upload.. to me it would be natural in the Upload case to clear the error with the onDelete event at least.. i tried in onDelete: ''' return new \atk4\ui\jsFunction([$form->js()->form('remove prompt', 'file_field_name')]); ''' but that gives me JS Error Message (Function Statement requires a function name) so I am guessing i am missing a few things..

stokkeland avatar Dec 07 '19 02:12 stokkeland

@PhilippGrashoff helped me with a solution workaround specifically to Upload - in onDelete: return $form->js()->form('remove prompt', 'file_field_name');

stokkeland avatar Dec 07 '19 20:12 stokkeland

Blocked by https://github.com/atk4/ui/pull/869

DarkSide666 avatar Jan 28 '20 16:01 DarkSide666

@DarkSide666 still valid?

mvorisek avatar Jun 08 '20 22:06 mvorisek

@ibelar Can you please check this sometime ?

DarkSide666 avatar Jun 09 '20 14:06 DarkSide666

no response, please reply if the problem is still present

mvorisek avatar Oct 03 '22 22:10 mvorisek