How to edit?

tshirley 01 Apr, 2011
Hello,

I'm very new to Chronoconnectivity and somewhere I have lost my way.

I have a Chronoform for adding records and this works fine. I have records in the table, and all is well.

Now I want to be able to edit these records, so I worked through the first couple of CC tutorials and I now have a nicely formatted listing of the database records, and I put this form name in the Record Edit Form area for both the front end and admin.

In the Admin I can show data, select a record and when I click edit the form appears. I can change data and submit, but the record doesn't change.

In the front end I don't know what to do. I can get the nicely formatted listing but all I can do is look at it.

I can't find any tutorial that takes me through how to set up a working edit, on either Front end or admin..

Hope someone can help.

Cheers

Tim
GreyHead 01 Apr, 2011
Hi Tim,

It's the next one to get written - but at the moment I'm gettgn buried in ChronoForms v4 posts here.

You can set up an {edit_record} link directly from ChronoConnectivity to the edit for you specify there.

Personally I prefer more control and set up a normal <a href'. . .> style link to a ChronoForm that I have built to edit the record. This must be passed the record id in the href URL and include it in a hidden input so that the correct record is updated.

You can use the Profile Page plug-in as an easier way of creating an editable ChronoForm that will load data for you.

Bob
tshirley 01 Apr, 2011
Thanks Bob,

But I'm sorry, you have lost me completely. I'm a total novice in CC so I really don't know what to put where. Once I have got something going (like the listing from the tutorial) I can see what is happening and why, but at this stage I am far from that.

Where do I put the {edit-record} ? And unfortunately "This must be passed the record id in the href URL and include it in a hidden input so that the correct record is updated." is not something I understand except in principle - clearly the edit form must be able to select the record somehow, but you are assuming that I have a good deal of html or php knowledge, but I don't.

I'm happy to learn and don't want to take too much of your time. CF is terrific and I have had few problems with my forms, but CC seems to need a lot of quite deep technical knowledge.

Happy also to take this off-line if I'm being completely stupid.

Thanks

Tim
tshirley 03 Apr, 2011
Hello,

A bit more research and a lot of progress on this one🙂

I read a few more forum discussions in an attempt to solve this for myself, and on the basis of that I did the following:

1. Made a copy of my data entry form and added a field with the cf_id in it.
2. Created a new form with one field, to enter the cf_id for a record I wished to edit (Select_form).
3. Added some form code into my Select_form (copied and modified from another post) to create a dynamic redirect URL. The code is in the onSubmit "after" box:

<?php
// get the parameters
$record = JRequest::getString('cf_id', '', 'post');
$record = urlencode($record);

// create the redirect url
$url = 'index.php?option=com_chronocontact&chronoformname=2012_Entry_Edit&cf_id='.$record;
// set the ChronoForms ReDirect URL to the new value
$MyForm->formrow->redirecturl = $url;
?>

I then created a Profile page for the edit form, selecting the correct table and the field name (cf_id) and using the request parameter cf_id which matches the parameter in the url.

The select form works, and the redirect url populates the edit form with the correct record. Good so far...

I can change data in the form, but when I submit the edited data the form works, the debug record looks fine, but the record is not updated in the DB. Is there some code I need to put in the edit form on Submit to update the record?

Hope someone can help me over this hurdle - I know it is inexperience only.

Cheers

Tim
nancyh 24 Jul, 2011
OMG I am never going to get this! Only with Bob's help did I manage to have a table at all...

I can go to chronoconnectivity / connections management / show data and get a list of checkboxes and data entry listed by number (no other info to identify them) and when I click a box and choose edit I get a blank page. Using Firefox 5.0.1.

So now apparently I need to create a table to edit the data? All is likely lost. I'm thinking about reverting to stone tablets...that I might be able to do. This is all me, I'm sure...I am NOT a programmer nor a developer. I broker sites and normally pay someone to do this stuff for me...but have a project with no budget left but hopefully a few coffees for Bob when I can get it all working...sigh

Tell me this -- is the "view details of a record" tutorial the one that contains answers to my problems above?? I've fallen down the rabbit hole for sure now...
GreyHead 25 Jul, 2011
Hi Nancy,

The View Details tutorial lets you view the details of a record; you have to go a little further to be able to edit them. Usually I think it just requires setting up a form using the Profile plug-in set to edit. If you already have a from to create the records then you can use this or a copy of it.

Bob

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