Forums

chronoform edit adds new record

skittle 25 Jul, 2013
I have a Chronoform that is called from a link in a Chronoconnection. In other words, if I click a hyperlink in my Chronoconnection the link opens a new page with the appropriate form. I have configured the form to look for a cf_id parameter that I pass via the URL. When the Chronoform opens it gets the cf_id parameter and its corresponding value from the URL. Everything works perfectly. The form is loaded with the appropriate record and is ready to be edited. I can edit a field (or fields) and press submit and everything seems fine. However, when I look at the corresponding table with PHPMyAdmin I see that the system has added a new record instead of updating the record I had thought I edited.

What makes this tricky is that my form does have a hidden cf_id field.

On load a debugger shows the cf_id field with the correct value.

    [CURRSTAT_ID] => Array
        (
            [cf_id] => 35
            [cf_uid] => 793622559c2d360b9c9558ddb580aa34
            .
            .
            .
         )

On submit another debugger shows the value of cf_id is not assigned and a new value has been assigned to a cf_id field under the Model ID for this table.

    [cf_id] => 
    [input_submit_10] => Submit
    [a6d6dbf0a63dd342c40f97365d3351ee] => 1
    [currstat_id_cf_id] => 69

Of course this explains the added record but I can't figure out why the cf_id value is being assigned this way. I have other forms that work fine using the same technique.

Any thoughts on this?

Thanks,

John
GreyHead 26 Jul, 2013
Hi John,

I can only guess that something is overwriting the value of the hidden input but I don't know what. If it is a hidden input with an empty value then ChronoForms will normally assign the value from the calling URL.

Is there anything else with the same name?

Bob
GreyHead 26 Jul, 2013
Hi John,

I can only guess that something is overwriting the value of the hidden input but I don't know what. If it is a hidden input with an empty value then ChronoForms will normally assign the value from the calling URL.

Is there anything else with the same name?

Bob
skittle 26 Jul, 2013
This was a careless oversite on my part and probably due to the fact that I spent too long behind the computer yesterday. Model ID was the clue. The only field in my Chronoform that did not have the Model ID assigned was of course the hidden field cf_id. Changing the field to Model_ID[cf_id] solved the problem immediately.

Thanks and sorry for requesting assistance when the problem was due to user error!

John
This topic is locked and no more replies can be posted.