18 lines
404 B
JavaScript
18 lines
404 B
JavaScript
|
function clear(property_name, elements_id)
|
||
|
{
|
||
|
elements_id.forEach(element_id => {
|
||
|
let element = document.getElementById(element_id)
|
||
|
element[property_name] = ""
|
||
|
});
|
||
|
}
|
||
|
|
||
|
function fill_errors(errors, property_name)
|
||
|
{
|
||
|
Object.keys(errors).forEach(error_field =>
|
||
|
{
|
||
|
let element = document.getElementById(error_field);
|
||
|
element[property_name] = errors[error_field];
|
||
|
});
|
||
|
}
|
||
|
|
||
|
export {fill_errors, clear}
|