We use cookies to improve your experience. No personal information is gathered and we don't serve ads. Cookies Policy.

ExpressionEngine Logo ExpressionEngine
Features Pricing Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University
Log In or Sign Up
Log In Sign Up
ExpressionEngine Logo
Features Pro new Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University Blog
  • Home
  • Forums

Free Form - Passing a custom field through a HyperLink to fill a hidden text field

Development and Programming

ADtrace's avatar
ADtrace
13 posts
16 years ago
ADtrace's avatar ADtrace

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

       
smartpill's avatar
smartpill
456 posts
16 years ago
smartpill's avatar smartpill

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.

       
Adam George's avatar
Adam George
283 posts
16 years ago
Adam George's avatar Adam George

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.

       

Reply

Sign In To Reply

ExpressionEngine Home Features Pro Contact Version Support
Learn Docs University Forums
Resources Support Add-Ons Partners Blog
Privacy Terms Trademark Use License

Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.