Formbuilder / Listit2 connect recipient (UDT?)

Have a question or a suggestion about a 3rd party addon module or plugin?
Let us know here.
Post Reply
User avatar
erpee
Power Poster
Power Poster
Posts: 771
Joined: Sat Jul 07, 2007 9:22 am

Formbuilder / Listit2 connect recipient (UDT?)

Post by erpee »

I have a Formbuilder-form that will be executed by a Listit2 module.

The various items in the module all have their own emailaddresses.

Is there a way to connect the emailaddress which comes out of the listit2 module to the Formbuilder form? (by e.g. a call or an UDT)
Waarom zou het direct goed moeten gaan? Dan is alle lol weg ...
Stikki

Re: Formbuilder / Listit2 connect recipient (UDT?)

Post by Stikki »

Passing Default Values to Forms

Calguy added a nice feature, which is that you can pass default field values to your form via the module tag. This allows you to have the same form in multiple places, but with different default values. It may not work for more exotic field types, but for fields that have a single value, you can specify like:

{FormBuilder form='my_form' value_FIELDNAME='default_value'}

This will set the field with FIELDNAME to 'default_value'.

This can be problematic, as sometimes field names are unwieldy or contain characters that don't work well with Smarty. So there is an alternative like this:

{FormBuilder form='my_form' value_fldNUMBER='default_value'}

That uses field NUMBER, where NUMBER is the internal FormBuilder field id. You might wonder how you know what that id is. Simply go into the FormBuilder configuration tab, and check "Show Field IDs"
User avatar
erpee
Power Poster
Power Poster
Posts: 771
Joined: Sat Jul 07, 2007 9:22 am

Re: Formbuilder / Listit2 connect recipient (UDT?)

Post by erpee »

Thanks, I'll give it a try.
Waarom zou het direct goed moeten gaan? Dan is alle lol weg ...
User avatar
erpee
Power Poster
Power Poster
Posts: 771
Joined: Sat Jul 07, 2007 9:22 am

Re: Formbuilder / Listit2 connect recipient (UDT?)

Post by erpee »

Stikki wrote: {FormBuilder form='my_form' value_fldNUMBER='default_value'}

That uses field NUMBER, where NUMBER is the internal FormBuilder field id. You might wonder how you know what that id is. Simply go into the FormBuilder configuration tab, and check "Show Field IDs"
I've tried this but I can't seem to find the ID for for the recipient address.

This is the form how it looks in the source code of the website ...

Code: Select all

	<form id="cntnt01moduleform_2" method="post" action="http://localhost/testsite/index.php?page=form" class="cms_form" enctype="multipart/form-data">
<div class="hidden">
<input type="hidden" name="mact" value="FormBuilder,cntnt01,default,0" />
<input type="hidden" name="cntnt01returnid" value="57" />
<input type="hidden" name="cntnt01fbrp_callcount" value="1" />
</div>

	<input type="hidden" id="cntnt01form_id" name="cntnt01form_id" value="2" />
<input type="hidden" id="cntnt01fbrp_continue" name="cntnt01fbrp_continue" value="2" />
<input type="hidden" id="cntnt01fbrp_done" name="cntnt01fbrp_done" value="1" />

	<div class="formbuilder">
				        	<fieldset id="fbrp__13"><legend>Contact</legend>     				        	<div><label for="fbrp__14">Your Name</label><input type="text" class="cms_textfield" name="cntnt01fbrp__14" id="cntnt01fbrp__14" value="" size="25" maxlength="128" />
</div>     				        	<div><label for="fbrp__15">Your Email Address</label><input type="email" class="cms_emailfield" name="cntnt01fbrp__15[]" id="cntnt01fbrp__15[]" value="" size="25" maxlength="128" />
<input type="checkbox" class="cms_checkbox" name="cntnt01fbrp__15[]" value="1" />
<label class="cms_label" for="cntnt01fbrp__15[]">Send me a copy of form</label>
</div>     				        	<div><label for="fbrp__16">Email Again</label><input type="email" class="cms_emailfield" name="cntnt01fbrp__16" id="cntnt01fbrp__16" value="" size="25" maxlength="128" />
</div>     				        	<div><label for="fbrp__17">Onderwerp</label><input type="text" class="cms_textfield" name="cntnt01fbrp__17" id="cntnt01fbrp__17" value="" size="25" maxlength="128" />
</div>     				        	<div class="required"><label for="message">Message*</label><textarea name="cntnt01fbrp__18" cols="60" rows="5" class="cms_textarea" id="message"  onfocus="if(this.value==this.defaultValue) this.value='';" onblur="if(this.value=='') this.value=this.defaultValue;" required="required">Enter Your Message Here</textarea></div>     							        	</fieldset>     				<div class="submit"><input class="cms_submit fbsubmit" name="cntnt01fbrp_submit" id="cntnt01fbrp_submit" value="Submit Form" type="submit"  /></div>
	</div>
	</form>
Waarom zou het direct goed moeten gaan? Dan is alle lol weg ...
User avatar
velden
Dev Team Member
Dev Team Member
Posts: 3497
Joined: Mon Nov 28, 2011 9:29 am

Re: Formbuilder / Listit2 connect recipient (UDT?)

Post by velden »

You want to be able to set the email address of the receiver dynamically?

What TYPE (exact) field do you use? *Email Results to set Address(es)?
It may not work for more exotic field types, but for fields that have a single value, you can specify like:
If I check the checkbox like Stikki suggested I can see the ID of the FIELD (not the address). But I don't know if setting the email address works like he suggested. You should just test it.

Of course you won't find the ID in the page html source. This field is not displayed on frontend.

If you can't set the recipient address, maybe you can mis-use the '*Email "From Address" Field, and send copy' field. Make sure to not display it on the frontend.
Stikki

Re: Formbuilder / Listit2 connect recipient (UDT?)

Post by Stikki »

Like this maybe?

Code: Select all

FormBuilder form='my_form' value_fld666=$item->email_field_of_listit}
Post Reply

Return to “Modules/Add-Ons”