Preset Field Value via Parameter

Barry created the topic: Preset Field Value via Parameter

We have a website of properties
When a user finds a property of interest we want to offer a LINK which takes them to a Contact Form requesting a viewing of that property
So the Link should be to a 'View This Property' Form, which we can easily create BUT needs to have the Property Name attached and then inserted into the appropriate form field
How can we pass this within the html link ?
And get it into the 'value' parameter for the correct field ?

Thanks

#21113

Please Log in or Create an account to join the conversation.


Support replied the topic: Preset Field Value via Parameter

Dear Barry,

As we understood you correctly, you need to generate a link to a form, and add it to that property text with an <a> tag. If we are right, then you can create an article, place the form with its shortcode and generate the desired link.

Thank you.


Best regards,
Web-Dorado team


Joomla extensions ,
Wordpress plugins ,
Drupal modules
#21161

Please Log in or Create an account to join the conversation.


Barry replied the topic: Preset Field Value via Parameter

Thanks for the reply (& happy New Year!)

Yes, we need to create a link (or Button) within the 'Property Description Text' to jump to an article which contains a FORM

The Form has a text field called 'Property_to_view'

When I generate the 'Property Description Text' (in a K2 sub-template) I have the property name in
a PHP variable and need to pass this name to the form so that it appears in the field 'Property_to_view'

Can I just make the link

<a href="...../article?Property_to_view='<?php echo $property_name; ?>';">View This Flat</a>

Will the variable get through to your FORM+field

Is there any chance of a template override where I can look for

if(isset($_GET["Property_to_view"])) and set the field value=$_GET["Property_to_view"]

Thanks

#21176

Please Log in or Create an account to join the conversation.


Barry replied the topic: Preset Field Value via Parameter

Is Javascript the answer ?

#21201

Please Log in or Create an account to join the conversation.


Administrator replied the topic: Preset Field Value via Parameter

Dear Barry,

Yes, you should use Javascript for putting data into the form field.

Thank you.

#21203

Please Log in or Create an account to join the conversation.


Barry replied the topic: Preset Field Value via Parameter

Thanks again

I have included a js function in the <head>

<script type="text/javascript">
function GetUrlValue(VarSearch){
var SearchString = window.location.search.substring(1);
var VariableArray = SearchString.split('&');
for(var i = 0; i < VariableArray.length; i++){
var KeyValuePair = VariableArray.split('=');
if(KeyValuePair[0] == VarSearch){
return KeyValuePair[1];
}
}
}
</script>

AND in theFormMaker Form Javascript section

// Occurs before the form is loaded
function before_load()
{
var iwview = GetUrlValue('iwview');
document.getElementById('wdform_1_element_last14').value = iwview;
}

But its not working when I add &iwview=xxxxxx to the URL

Am I missing something ??

#21274

Please Log in or Create an account to join the conversation.


Administrator replied the topic: Preset Field Value via Parameter

Dear Barry,

Can you give us link with that form?

#21356

Please Log in or Create an account to join the conversation.


Barry replied the topic: Preset Field Value via Parameter

Hi

I have found another solution
I have written a simple Joomla Plugin which gets the passed parameter from the URL and replaces some Dummy Text in the Form

Seems to work & is flexible

Regards

#21359
The following user(s) said Thank You: Support

Please Log in or Create an account to join the conversation.


Support replied the topic: Preset Field Value via Parameter

Dear Barry,

Thank you for sharing this information.


Best regards,
Web-Dorado team


Joomla extensions ,
Wordpress plugins ,
Drupal modules
#21382

Please Log in or Create an account to join the conversation.


Ron Schroeder replied the topic: Preset Field Value via Parameter

I have a similar problem although I want to pass logged in user name and email to populate corresponding form fields. Any thoughts?

#21573

Please Log in or Create an account to join the conversation.


Support replied the topic: Preset Field Value via Parameter

Dear Ron,

Could you please give us more details about your requirement?
Thank you.


Best regards,
Web-Dorado team


Joomla extensions ,
Wordpress plugins ,
Drupal modules
#21592

Please Log in or Create an account to join the conversation.


Ron Schroeder replied the topic: Preset Field Value via Parameter

The scenario is this:
- The client is a farmer that has a program for vegetable delivery.
- They will create login profiles for their clients who will then log in and fill out a form for the products they want delivered.
- The Form module is only visible to registered users so once the client logs in I would like to pass the users name and email address to the 'Name' and 'Email' form field (as apposed to logging in and then fill in your name and email which seems redundant).

Not sure if this is possible. Also, the site is localhost so nothing for you to look at.

Thanks,
Ron

#21614

Please Log in or Create an account to join the conversation.


Support replied the topic: Preset Field Value via Parameter

Dear Ron,

Please be informed, that the autofil functionality as you've mentioned is not available in Form Maker by default.
Thank you.


Best regards,
Web-Dorado team


Joomla extensions ,
Wordpress plugins ,
Drupal modules
#21647

Please Log in or Create an account to join the conversation.


Time to create page: 0.268 seconds
Powered by Kunena Forum

WORLD-CLASS SUPPORT

We are here for you every step of the way. Turn to our support with any questions you might have about our products and services. Our experienced customer care team is available to help you as fast as we possibly can.

Contact us