Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 24 additions & 2 deletions src/components/com_tjucm/media/js/ui/itemform.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,15 +31,37 @@ jQuery(window).load(function()
jQuery("#item-form").on("change select", ":input", function(){
if (tjUcmCurrentAutoSaveState)
{
tjUcmItemForm.onUcmFormChange(this);
// Call function if field name & value exist in request data
if (jQuery(this).attr('name') !='' && jQuery(this).attr('name') != undefined)
{
// If field is required and user tried to remove value then no need to call function
if ((jQuery(this).attr('required') == 'required' || jQuery(this).attr('required') == true) && jQuery.trim(jQuery(this).val()) =='')
{

return false;
}

tjUcmItemForm.onUcmFormChange(this);
}
}
});

/* To save calendar field value */
jQuery("#item-form .field-calendar input:text").blur(function(){
if (tjUcmCurrentAutoSaveState)
{
tjUcmItemForm.onUcmFormChange(this);
// Call function if field name & value exist in request data
if (jQuery(this).attr('name') !='' && jQuery(this).attr('name') != undefined)
{
// If field is required and user tried to remove value then no need to call function
if ((jQuery(this).attr('required') == 'required' || jQuery(this).attr('required') == true) && jQuery.trim(jQuery(this).val()) =='')
{

return false;
}

tjUcmItemForm.onUcmFormChange(this);
}
}
});

Expand Down
Loading