mirror of
https://github.com/grocy/grocy.git
synced 2026-04-05 12:26:15 +02:00
parent
5ecd3a585e
commit
eba2925e01
|
|
@ -244,17 +244,14 @@ if (GetUriParam("embedded") !== undefined)
|
|||
}
|
||||
|
||||
var eitherRequiredFields = $("#product_id,#product_id_text_input,#note");
|
||||
eitherRequiredFields.on("input", function()
|
||||
eitherRequiredFields.prop('required',"");
|
||||
eitherRequiredFields.on('input', function ()
|
||||
{
|
||||
eitherRequiredFields.attr("required", "");
|
||||
if (!$(this).val().isEmpty())
|
||||
{
|
||||
eitherRequiredFields.not(this).removeAttr("required");
|
||||
}
|
||||
|
||||
eitherRequiredFields.not(this).prop('required', !$(this).val().length);
|
||||
Grocy.FrontendHelpers.ValidateForm('shoppinglist-form');
|
||||
});
|
||||
|
||||
|
||||
if (GetUriParam("product-name") != null)
|
||||
{
|
||||
Grocy.Components.ProductPicker.GetPicker().trigger('change');
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user