Assuming a form was loaded with 10 text fields with a value of 1, and the user changed one of these to 0.
When submitting the form, is there something 'native' that identifies that it has had a change in the value of its fields?
I want this to differentiate the trigger of an event when the user did or did not make any changes to the open editing form.
Currently I use a very extensive process for this, when submitting, I get all the variants of the input, I look for the data that was in the bank, I compare field by field to know if there was modification and to define what the event will be triggered, I think There should be a more efficient way, but I could not find it.
I wanted something native or one that comes naturally because of the reason:
I do not write events for a submission, I have a framework with abstract event that makes the whole process, from validation, sealing masks, concatenation and submission of any form (provided the form has also been generated by the framework ), the solution must be something that I can convert into something universal, otherwise I can not implement it in the framework.
Rendering example:
$campo = $VIDB_input->field('campo')->mask('mascara_que_eu_quiser')->type('text')->validator('validacao_que_eu_quiser')->additional_classnames('classnames_que_eu_quiser')->value($data['valor_trazido_do_bd'])->datepicker(false)->dateranger(false)->input(0);
$form_group = $VIDB_form_group->group_cols(12)->input($campo)->input_cols(12)->label('Campo: ')->label_cols(12)->form_group(0);
$submit = $VIDB_button->color('primary')->content('Salvar edições')->addicionalClassnames('pull-right')->event('submit_fake_form|caller|geralOperationalCompanies|save_edited|sectorGeral|closeClosestModalOnSuccess|json|primary-modal|SweetAlertByResponse')->event_post_content(null)->type('submit')->button(0);
$form = $VIDB_fake_form->classnames()->content($form_group.$submit)->form(0);
This code, does the whole process of:
Rendering the form, concatenating the data, dropping the mask in the input, validating client-side real-time, validating server-side and responding and submitting the form, I would need to somehow also make this comparison somewhat global.