Welcome to the LimeSurvey Community Forum

Ask the community, share ideas, and connect with other LimeSurvey users!

Default value in email address field when saving a survey response

More
4 years 9 months ago #186052 by aabc
Hello,

Is it possible to have a default value or auto-filled email address in the email address field on the saving survey screen (screenshot attached) so that the email address doesn't have to be typed in every time a survey response is saved? I only know of the auto-fill options in browser settings.

Thank you,
Jennifer

Jennifer Wright
The topic has been locked.
More
4 years 9 months ago #186056 by jelo
The email address is optional. I wonder why different probands should get the same default/prefilled emailadress which doesn't belong to them.

I'm not aware of the an default email address setting for that page. Never seen a feature request for that page. What is your usecase?

The meaning of the word "stable" for users
www.limesurvey.org/forum/development/117...ord-stable-for-users
The following user(s) said Thank You: DenisChenu
The topic has been locked.
  • tpartner
  • tpartner's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
4 years 9 months ago - 4 years 9 months ago #186082 by tpartner
If using tokens, you can set a default value by extending your theme and editing the "Email" block of save.twig so it looks something like this:

Code:
<!-- Email -->
{% set tokenEmail = processString('{strip_tags(TOKEN:EMAIL)}') %}
<div class='{{ aSurveyInfo.class.saveformsurveydive }}  form-group ' {{ aSurveyInfo.attr.saveformsurveydive }}>
    <label class='{{ aSurveyInfo.class.saveformsurveydivelabel }} control-label col-sm-3 ' {{ aSurveyInfo.attr.saveformsurveydivelabel }} >
        {{ gT("Your email address:") }}
    </label>
    <div class='{{ aSurveyInfo.class.saveformsurveydivediv }} col-sm-7 ' {{ aSurveyInfo.attr.saveformsurveydivediv }}>
 
        {% set htmlOptions = {
                'id'          : 'saveemail',
                'name'        : 'saveemail',
                'class'       : 'form-control',
            }
        %}
 
        {{ C.Html.emailField(
                'saveemail',
                ''~tokenEmail~'',
                (htmlOptions)
        )  }}
    </div>
</div>

Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
Last edit: 4 years 9 months ago by tpartner.
The topic has been locked.

Lime-years ahead

Online-surveys for every purse and purpose