In many application we see If anyone want to create for example category of a product, I want to make it more desktop like using jQuery Ajax.
Here is my idea:)
A form with a text field for category title. and a button will be there “create and add another”. when user clicks this button a category is successfully adding to DB using $.post but after that how I can make the form appear again as many times user wants?
if (user submits form) {
post values using AJAX with the callback function {
if (values are ok) {
show message "successfully saved"
empty fields
} else {
show message "failed to save. The following errors occurred: ..."
}
}
}
after the submission was successful and the values were ok the user is presented with the same form but empty and can start anew