I have a dialog form and when I open it I have the button “add a task”, I would like to keep this “name”, when I open the form from an empty case, but I want to have a button named “edit this task” when I open an already existing task.
I also want to send the form with this button when I push enter key, no matter where I am on the form.
Thank you.
Here is what I did, it works but as I’m beginner and have not a lost of time to work on jQuery it kind of sucks, especially the selector redundancy and the each wich is useless (but I don’t know how to take only that element.)