Forums

Recall original form and store new record, not edit

mkusens 27 Oct, 2012
I have been able to use CC to list data from a table originally populated using a CF form. I also used the edit fields to be able to recall the original form with the fields populated from the record I selected. However, when I submit the form it updates the original record which I realize is what it is supposed to do.

My question is how to I instead of causing it to edit the record, to store a new record when I submit the form.

Thanks,

Michael
GreyHead 28 Oct, 2012
Hi Michael,

There's an Add option that will open a new empty form and add a new record.

I don't think that you can over-ride the ChronoConnectivity Edit option to have it create a new record (or at least I don't know how to do that).

You could link directly to a stand-alone ChronoForm and either pass a 'new record' indicator in the URL or add a checkbox in the form. You'd need to check these in the On Submit event of the form and then remove the value from the 'primary key' input before the DB Save action.

Bob
Max_admin 03 Nov, 2012
Hi Michael,

You will need to add a "Custom code" action in the "on submit" event of the form and unset the primary key field value:


<?php
$form->data['cf_id'] = ''; //assuming pkey is cf_id
?>


Regards,
Max
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
This topic is locked and no more replies can be posted.