How can i save the campaign name from responsys on a form - forms

I'm trying to get the name of the campaign where the person opened the form and save it in the supplemental table of the form.
I saw that it has the campaignname() function but I didn't know how to use it.
the form call in the body of the email:
$personalizedform('test_form', 'EMAIL_ADDRESS_',concat(CAMPAIGN_NAME=campaignname()))$
and the hidden field in the form:
<input type="hidden" name="CAMPAIGN_NAME" value="$CAMPAIGN_NAME$">

i managed to figure out how to do this and it was really dumb of me not to notice it but i can just use campaign.name in the form call

Based on what the limited information, I'd think that you'd want to write your form input to a supplemental table using the form rules, and have the input name/id match a column in your supplemental table.
The freemarker/RPL code to pass campaign name to a form would look something like this: ${form('test_form','EMAIL_ADDRESS_','CAMPAIGN_NAME='+campaign.name())}
Sources:
Responsys Form Method
Responsys Namespace Reference

Related

SuiteCRM turn ON autocomplete on email recipient field

I'm trying to remove the autocomplete="off" attribute from the input field for the email recipient field
The code of the input field is as follows:
<input
class="ac_input yui-ac-input"
size="96"
id="addressTO1"
title="An"
name="addressTO1"
onkeyup="SE.composeLayout.showAddressDetails(this);"
autocomplete="off" type="text">
Is there a setting that can be accessed via the GUI that changes the behaviour of the email "to" field or what would be the best way to turn on the autocomplete functionality.
Just removing it does not work, as there is some javascript functionality there, that keeps bringing it back.
I'm using suiterCRM version 7.6.5
Sugar Version 6.5.23.
There is no GUI for changing that, the autocomplete=off is hardcoded.
The TO field (addressTO1 dynamically generated name) is not a regular text input field, it will support multiple emails separated by comma, so a autocomplete="email" will not work.
The only solution I could come up with is for you to create a javascript function and attach to the keyup event of the field and show your logic.
Also you will need to save previously filled input with the answers and provide a mechanism to delete that. Not an easy solution I am afraid.

how to create a form elements with value in moodle

I am trying to create a form element text with value in moodle.
I trying the below :
$mform->addElement('text','test', get_string('test'));
This is used to create a text box . i want to add value also like
<input type='text' value='<?php .... ?>' />
How to do that in moodle
When you instantiate the form, you can pass the relevant data into it, e.g.
$form = new my_form();
$formdata = (object)array('test' => 'The value to display in the textbox');
$form->set_data($formdata);
(Usually the data passed into the form is some existing data retrieved from the database).
I'm not sure what kind of data did you mean here.
If you want to set user data (for example, you are developing a form that edits existing record), then use $form->set_data() after creating a form instance as Davo suggested.
If you want to pre-fill the form with default value, then use this inside the form definition:
$mform->addElement('text','test', get_string('test'));
$mform->setDefault('test', 'your default value');
You can use both methods, in which case the data from set_data() will have priority.

How to send multiple forms with one button in Contao?

I have a question about the wrappers/accordeons. I now have multiple wrappers and in each wrapper there is a form. Now, I want one sendbutton on the end of the page. The sendbutton which will send all the forms that have been filled in at once.
How can I do that?
I don't know why you want to break input into different forms and then submit them again at once. Would it not make sense to use one form and submit the data and process it the way you want using the processFormData hook? may be because you want the accordion to group you form fields. Let me help you this way:
Create your form in the format shown below. Make sure the form has a tabless layout to be able to use fieldsets.
Create a fieldset without a label. You may add the class ce_accordion just in case you have some styling attached to it.
Create a field of type html and add the following markup.
<div class="toggler">Form 1 headline here</div>
Create another field with the following markup
<div class="toggler">
Now create your input fields from here. for example a text field,textares.
Create a field of type html to close html markup created in step 3
</div>
Create a fieldset wrapper end here.
The above steps can be repeated as many as how many groups of fields you want to create in an accordion.
Now create you submit button here and it will send all your data the way you want.
Just a by the way:
If some one submits a form in a wrapper that is closed, how will he know which wrapper has error fields?
$(document).ready(function() {
$(".ce_accordion").each(function(index,el) {
if($(this).find("p.error")){
$(this).addClass("hasErrors");
$(this).find("div.toggler").addClass("active").attr("aria-expanded","true");
}
});
​});​
You can now add a style for .hasErrors rule

Is there a way to deliberately make a form field that doesn't submit?

A lot of folks on Stack Overflow are probably trying to fix forms that don't submit, but I'm actually hoping to do the opposite!
What I'd like to do for an art project is make a form with a "joke" field -- say, your SSN, your bank account number, your fingerprints or retina scans or DNA code, or something super personal like that. But I don't want the number in our server logs, and I don't want it to be transmitted over the internet at all. I don't want any legal liability!
Basically the idea is just to ask for something audacious, but not to handle the data that may or may not come from users who actually put it in.
So, is there a way to make a field that acts as a normal form field, but where nonetheless we would feel "safe" that users who actually do put their sensitive info in the field will be protected?
What's the "safest" approach to something like this?
Form fields require a name to be submitted:
If any of the following conditions are met, then skip these substeps for this element:
[…]
The field element is not an input element whose type attribute is in the Image Button state, and either the field element does not have a name attribute specified, or its name attribute's value is the empty string.
[…]
So you could simply use an input without name attribute:
<input type="text">
Be careful with your "jokes", if you want that the information of the field is not submitted, then, you can simply leave it out of the form element like this:
<form action="... >
<input type="... >
</form>
<input type="... > <!-- This field won't be submitted-->

Is it possible to pass post data to the form (prefill form with data)?

For example https://stackoverflow.com/questions/ask there we have form id="post-form" which has method="post", is it possible somehow open this form and have lets say Name input (display-name) with my name prefilled on load?
Yes. You can do this many ways, with Javascript by setting the input's text, or you can do it server-side with PHP by echoing "value=\"$name\"" for the value attribute of the input.