Forums

launch a custom event with a button inside a form

artcode 23 Mar, 2014
Hi there,

Is it possible to create a button in form (not the submit) to launch a custom event with some actions inside?

Thanks in advance.

bye
fede
GreyHead 23 Mar, 2014
Answer
Hi fede,

Yes, the simplest way is to use a link (which can look like a button) and use &event=your_event_name in the URL.

The more complicated way is to add an extra submit button to your form with a different value, then when the form is submitted check which button was used and redirect as needed.

Bob
artcode 23 Mar, 2014
Hi,
thanks for the answer.

I could create a link to event inside the form as bob suggest with:
index.php/component/chronoforms/?chronoform=name_of_form-custom&event=name_of_event

1- the link points to the event in cf4, but how to pass the data in the html inside the event action?

2- if I use the form in chronoconnectivity (configure in the connnection for the edit with the cf4form) when I exit from edit using the link, I couldn't open the event because I 'd redirect directly to the chronoconnectivity list, how I could override this behaviour?

3-in chronoconnectivity the form is full, how I could pass the data to the html inside the event action?

thanks

bye
fede
GreyHead 24 Mar, 2014
Hi fede,

I'm sorry, I find your question very confusing.

1. I think I have just answered in another thread.

2 & 3 seem to have something to do with ChronoConnectivity but that wasn't mentioned in your original question.

Bob
artcode 24 Mar, 2014


I'm sorry, I find your question very confusing.



sorry I try to explain better...... and thanks for your help.


1. I think I have just answered in another thread.



sorry... I miss the answer, the others question are different to me, the arguments are similar too...
But the way you apply the solutions is different, task control in CC4, button from a list in CC4,
link in CF4 or in edit mode with the same form in CC4.
Three cases that I separate in three posts.

but I understand, I try to be more clear.

in chronoforms:
The link in cf4form link ok to the event, I prepare a target page inside an action in the event.
but when a click the link the page appears but without the data.

1-could I move the data from the form to the html format without pass from the submit?
2- if I had to use the submit could I have two button one to save the data and the other to direct to the print action
in the form?
or
3-Is there an action that I could use to pass the data?
4-Is there a way to pass the data with the url link?


2 & 3 seem to have something to do with ChronoConnectivity but that wasn't mentioned in your original question.



Yes, after I create the form I associate it win a connection in chronoconnectivity, when I open the form to edit the record
in CC4 the link didn't call the event like in CF4 but return to the admin page.

To be clear I couldn't use this kind of link in CC4 when I open the same CC4 form in editing mode.

Sorry but when you create your form and use CF4 an CC4 isn't so easy to separate the two things.

At this point I couldn't find a way to pass data to a format dedicated to print when I open the form in edit mode (the single record I mean).

In two world I couldn't print a single record in edit mode in CC4, or if there is a solution I don't know how to apply that solution at my case.

I try to search in the forum but I didn't find a similar case that contains an aswer, if you could point out to other documentation, faq, or posts I will read with interested.

Thanks

bye
fede
artcode 24 Mar, 2014
errata: with interest sorry🙂
GreyHead 26 Mar, 2014
Hi fede,

I still find this hard to understand :-( I think that a lot gets lost in translation.

If you want to pass data from one form event to another, or one form to another there are two main ways to do it.

a) you can pass a record identifier e.g. cf_id=999 in the URL and then look up the data from a database table.

b) If you already have the data you can save it to the Joomla! User session in one form and get it back in another. ChronoForms has the session to data and data to session actions to help with this.

Bob
artcode 26 Mar, 2014
thanks for your answer and for your contribution in the post🙂.

I arrive at a solution at the end, with linkable fields as I describe in another post.
The part that was not clear was how to pass the data when I call an event from CC4, at the end the action accept data from the array with this sintax:

{connection_data.0.field_name} 


but I couldn't find info about that and use the sintax as in CF4
{field_name}
then my target page was empty.

To remain in theme with the title of the post:

a- I could use the link inside the form in CF4 to point to my event and pass data with
{field_name}

b- If I use the same kind of link in CC4 in edit mode I couldn't use it because in CC4 the link didn't call the event like in CF4 but return to the admin page. Then no way to use the link as in CF4.

bye an keep the good work!🙂
This topic is locked and no more replies can be posted.