I’d like to modify the way some of my edit forms work…on submitting the form, the user is prompted with an aler box. If he/she chooses “Yes” then the record will be edited…on choosing “Cancel” however, the record will be saved as a new record. Is this possible?
Share
I suppose your “alert box”, which allows your user to choose between “Yes / No”, is actually using the
confirm()function ?If so,
confirm()will return a truthy or falsy value, depending on what the user choosed.Which means you could use something like this :