Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
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
12 changes: 10 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,23 @@ 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 && jQuery(this).val() !='' && jQuery(this).val() != undefined)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@pravinTek Will this work, if a user has set some value for a field and later, is updated to blank?
jQuery(this).val() !=''
If a user sets fields value to blank then its value should be saved as balnk

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changed logic and restrict function call for required field only

{
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 && jQuery(this).val() !='' && jQuery(this).val() != undefined)
{
tjUcmItemForm.onUcmFormChange(this);
}
}
});

Expand Down
Loading