Hi!
I have created a property rental website and setup an enquiry form using Free Form.
My query is how can I pass the name of a property using my custom field of “property_description through a hyperlink to my “Free Form” enquiry page to automatically fill a hidden text box so that when I receive the form I know which property the client is looking at?
Probably very simple but had me stumped for hours….
Thanks,
Olly
There may be some info available in the Freeform Forums but I assume since you’d be calling one template from another your could try to pass the info by adding something like
<input (keep all the other input field stuff) value="{exp:entrydata:field entry_id="{entry_id}" field="property_description" field_format="xhtml"}" />
to your input tag using [removed]. Let me know it that works since I’d probably need to do that myself in a few weeks. The field_format parameter should be set to whatever is appropriate for you.
Hmmm, couldn’t you use php in your template to achieve this?
Set php parsing to input.
Setup your field in freeform.
Then with a url like:
http://www.example.com/template_group/template/some_value
Use php in your template to get the url variable from segment 3:
global $IN;
//The following will both work, but I've found I get a notice in my php error log using the first one.
//$seg3 = $IN->SEGS[3]; //get the 3rd url segment
$seg3 = $IN->fetch_uri_segment('3'); //get the 3rd url segment
Then use php to insert the variable into the freeform form.
<input type="hidden" name="some_name" value="<?=$seg3;?>" />
Try that. I hope it works for you.
Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.