Changed the order of elements.
The function checks if the item submitted is different from item from DB.
If yes the item into DB will be updated.
Ajax call to initiate the update.
Changed the var name.