parsing a db item into a hyperlink

Twincarb , March 11 at 17:30
T
Twincarb

Hi Max & Bob,

I am wanting to pass the id paramater of a record to a url in order to have a link which will open an edit form in a modal window from a CC5 view. I am struggling to pass the id paramater into the html code. The lines below are what I have tried.

				
<?php
$id = ['job_view']['id'];
?>
<a href="/jobs/new-job-data?cont=lists&ccname=JobView&act=edit&gcb=<?php echo $id; ?>" >


I have also tried doing it with {job_view.id} as well directly in the html but that also doesn't parse.

Is there a way to use the form event directly in the view to generate the link? my event is R1_Form:load

Any hints on where I am going wrong?

The project details are I use a single form which is used to populate the db I then use CC to display the record, There are then 4 areas on the CC view that I require to put links for the edit forms, depending on who is logged on it depends on what they can edit.
This means there are an additional 4 edit forms which depending on which edit link is visible depending on the edit form they are presented with. This means they only edit the data that they need to be able to.

I can almost see the light at the end of the project....

Regards,

Dave

admin

Hi Dave,

Why not use v6 for this ?

I'm not sure where do you call that code but this line is wrong:

				$id = ['job_view']['id'];
				


You can use v5 forms and list the data using v6 if you just need to pass the id to the form, you may also point the form action url in v5 forms to the "save" event in v6 to store the data.

Moreover, v6 forms is almost ready and an official release is supposed to be in the next few days.

Best regards,
Max

T
Twincarb

Hi Max,

The error of my ways on this one was attempting to use php when all I needed was {job_view.id} in CC5 and this gave me the link to the data that I needed to appear in the form it was opening up.

I have used V6 for one project which I am working on which is looking up multiple tables, I need to get my head around it a bit more. I posted this when I was having problems loading this website. Also posted in the Chronoconectivity forum and figured the answer out.

Looking forward to seeing what's new in CF 6, once I have the time to learn php to a better level then I think projects will be easier. Still learning here!

Regards
Dave

admin

Hi Dave,

So you got this one working ? {job_view.id} may work, but it depends where you call this code.

Best regards,
Max

Powered by ChronoForums - ChronoEngine.com

ChronoForms Book

The ChronoForms Book, written for ChronoForms v3 contains 350 pages of invaluable ChronoForms How-tos hints and tips.

Note: many of the ideas can be used in ChronoForms v4 but the admin interface is very different and code examples may need to be modified.

SSL

Members Login

 

2CheckOut.com Inc. (Ohio, USA) is an authorized retailer for
goods and services provided by ChronoEngine.com