[eluser]Brandt1981[/eluser]
I am using CI and the doctrine plugin to do CRUD.
I want to be able to switch the submit destination function based on the state of the text boxes in the form.
If all the text boxes in the form are blank and I fill them out and hit submit, I want it to create a new database record ( know how to do the doctrine part ).
If the text boxes contain text as the result of a query by primary key ( I know how to query ) and then the text is modified, I want the submit to call on the update function in the controller to update the record. ( I got this part working but need to know how and when to switch between the different submits )
If the text boxes contain text and they are blanked out, then I want the submit to delete the field ( I think update will do this ) or do I need a delete function
Maybe this would be easiest with radio buttons at the top that specify
(Update, Create, Delete) Create being default if the text boxes are blank on a page load, or update being the default after returning a record...?