0

I have a channel "activities".

In my template the activities look like this:

Activity titel 1 | 10-10-2013

Some description text

sign-up for this activity >>

Activity titel 2 | 23-11-2013

Some description text

sign-up for this activity >>

Activity titel 3 | 24-11-2013

Some description text

sign-up for this activity >>

When somebody clic on "sign-up for this activity >>" you go to a form (I use Freeform) and I want the "Activity titel" and the activity Date to be already fill, for example:

Activity: Activity titel 1

Date: 10-10-2013

Name:

Adress:

email:

submit button

People just have to fill their name, address and email.

Can someone help me with this.

Francois

2

You need to pass the entry_id of the "activities" entry to the template that has the Freeform form.

<a href="/templategroup/template/{entry_id}">sign-up for this activity</a>

Then in the template with the form, you can do something like this:

{exp:channel:entries channel="activities" limit="1" dynamic="no" entry_id="{segment_x}"}
{exp:freeform:form
    form_name="sign-up"
    return="sign-up/thank_you"
}

<p>Your Activity: <input type="text" name="activity" value="{title}" /></p>
<p>Your Date: <input type="text" name="date" value="{your_date_field}" /></p>
<p>Your Name: <input type="text" name="name" value="" /></p>
<p>Your Adress: <input type="text" name="name" value="" /></p>
<p>Your Email: <input type="text" name="email" value="" /></p>

<input type="submit" name="submit" class="button" value="SEND"  />

{/exp:freeform:form}
{/exp:channel:entries}

Replace {segment_x} with the actual segment variable.

0
0

In the freeform tag, specify the "value" for each option you want pre-populated.

Taken and modified from the freefrom docs page here... http://www.solspace.com/docs/freeform/form/#tellafriend_form

{exp:freeform:form form_name="tell_a_friend"}

<p>Your Name: <input type="text" name="name" value="John Doe" /></p>
<p>Your Email: <input type="text" name="email" value="johns@email.com" /></p>

<p> Comments:<br />
    <textarea name="comments">
        Hey there! You should check out this site - it’s totally awesome!
    </textarea>
</p>

<p><input type="submit" name="submit" value="Send!" /></p>
{/exp:freeform:form}

You could also set the fields as hidden so the user cannot change them, plus there may not be the need to make the form more complicated by displaying additional fields that are not going to be used.

Hope this points in the right direction, be sure to check out all the docs, solspace has excellant documentation.

2
  • Thanks but I don't know how to "send" the information van my Activities template to the freeform. My form wil look like this: {exp:freeform:form form_name="sign-up" return="sign-up/thank_you" } <p>Your Activity: <input type="text" name="activity" value="pre-populated" /></p> <p>Your Date: <input type="text" name="date" value="pre-populated" /></p> <p>Your Name: <input type="text" name="name" value="" /></p> <p>Your Adress: <input type="text" name="name" value="" /></p> <p>Your Email: <input type="text" name="email" value="" /></p> <input type="submit" name="submit" class="button" value="
    – worfoual
    Jun 20 '13 at 15:32
  • Didn't get your response since you replied your question and not my comment. I would probably use segments to pass the data from the link to the page. yoursite.com/sign-up/activity1/10-10-2013 But I am not %100 sure if thats what you are looking for. Jun 20 '13 at 16:58

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.