I have noticed that if I submit my form using
<form method="post" action="">
and changing at least one of the input’s value it is working fine, I mean my save() function is working and saving my records to database.
However, if none of the input values are changed, else {} block is executed which is false for save().
Can anybody explain why it is so?
You may be using something like
After doing the database save sql query. So, when changes are made in the form fields, the changes are saved and the first condition becomes true returning true. But when no changes are made in the form field, i.e if the fields are kept intact, no changes is made to the database and the second, i.e else condition gets executed returning false.
UPDATE
I could be able to explain it to you more clearly if you post the code. There is nothing wrong with the html form code that you have posted. But you need to post the PHP code which is handling the save operation.