• Resolved KTS915

    (@kts915)


    Thanks very much for adding the “option to allow form fields to be prefilled with a value using shortcode attributes. The following values will be replaced intelligently: CURRENT_DATE(),CURRENT_DATETIME() and CURRENT_TIME()”

    My question is simply: how do we make use of this new option?

    https://www.ads-software.com/plugins/planso-forms/

Viewing 15 replies - 1 through 15 (of 21 total)
  • Plugin Author PlanSo

    (@planso)

    Hi KTS,

    You can use the values in the following manner:

    [psfb id="-ID-" First_Name="Some Name" Date_Field_Name="CURRENT_DATE()"]

    Where First_Name and Date_Field_Name are the corresponding field variables (the same that show up in the email settings).

    To be sure everything works as expected you should update to 1.3.0 as we’ve changed some parts of the shortcode handling with that update.

    Cheers

    Thread Starter KTS915

    (@kts915)

    Thanks, PlanSo, but I’m still not sure that I understand. Specifically:

    Where do I put the shortcode?

    Do I need to put in in the form itself if I want it to show in a response email? Or can I just have it in the email?

    Do I need to use [psfb id="-ID-" First_Name="Some Name" ... every time that I want to use CURRENT_DATE() or its alternatives?

    Thanks again.

    Plugin Author PlanSo

    (@planso)

    well the shortcode is placed either in your page or post content or in a widget. By adding the attributes the form will be prefilled with the value provided [psfb First_Name="Some Name"... would lead to the “first name” field to be prefilled with Some Name.

    The special values CURRENT_DATE(), CURRENT_TIME() and CURRENT_DATETIME() as the attribute value would be replaced by todays date in the format of 2015-04-14, the time when the form is submitted in 24h format like 23:08 and the combination like 2015-04-14 23:08 respectively.

    This all leads to the possibility to create individual default values for your separate fields. If you would like to receive the value without your users to be able to change the value we’d suggest you check “hide label” within the edit dialog and additionally enter display:none; into the css style field of the corresponding field.

    This way you’ll always receive the predefined value via email.

    Thread Starter KTS915

    (@kts915)

    This all leads to the possibility to create individual default values for your separate fields. If you would like to receive the value without your users to be able to change the value we’d suggest you check “hide label” within the edit dialog and additionally enter display:none; into the css style field of the corresponding field.

    This way you’ll always receive the predefined value via email.

    That is precisely what I’m doing. But then the date is also hidden in the email!

    Plugin Author PlanSo

    (@planso)

    We’ve just tested this on different sites and it is perfectly working the way described.

    Did you insert the appropriate variable into your admin/user mail body?

    Thread Starter KTS915

    (@kts915)

    No doubt the problem lies with me, but this is what I have done:

    1. Created a form, including the Date field.

    2. Chose to hide field name.

    3. Created CSS Class planso-date with CSS Style display:none;

    4. Inserted the shortcode [psfb id="3387" title="General Contact Form" Date_Field_Name="CURRENT_DATETIME()"] onto a page.

    5. Created User email form, including the line: Email sent: [Date] (I am using Pro v.1.0.7, so this is in HTML)

    6. On front-end, completed and submitted form.

    7. Result: email sent, but relevant line reads only Email sent:

    Where have I gone wrong?

    Plugin Author PlanSo

    (@planso)

    Hi, it seems you have a missmatch with the variable names. In your shortcode you are using Date_Field_Name but in the email you are using [Date].

    It should either be [psfb ...Date="CURRENT_DATETIME()"...] in the shortcode or [Date_Field_Name] in the email.

    We are working on direct email variables for the Pro version however. That way it’ll be a lot easier to use these defaults.

    Cheers

    Thread Starter KTS915

    (@kts915)

    Unfortunately, if I change it to [Date_Field_Name] in the email form, that’s exactly what I get in the email itself. In other words, I get: Email sent: [Date_Field_Name]

    Maybe I should just wait for the updates in Pro.

    Thread Starter KTS915

    (@kts915)

    Just tried going back to [Date] in the email, with [psfb ...Date="CURRENT_DATETIME()"...] in the shortcode, and got this in the resultant email:

    Email sent: January 2, 0018

    That adds a new layer of weirdness!

    Plugin Author PlanSo

    (@planso)

    KTS915 as of version 1.3.1 you don’t have to use the work around described above any more.

    You can now use one of the following three variables dierctly in your email body:

    • [psfb_current_date]
    • [psfb_current_datetime]
    • [psfb_current_time]

    So there is no need for extra hidden fields anymore.

    Thread Starter KTS915

    (@kts915)

    That’s great — thank you!

    There’s just one small issue left now. The time I’m getting is Greenwich Mean Time. Is there any way for the email to pick up the local time I’ve set in my WordPress installation?

    Plugin Author PlanSo

    (@planso)

    KTS915 we’ll fix this with version 1.3.2 where we’ll be using the WordPress date and time formats from the general admin settings. We’ll probably push out the update tomorrow morning.

    Thread Starter KTS915

    (@kts915)

    Thank you. That sounds great!

    Plugin Author PlanSo

    (@planso)

    The fix is out and 1.3.2 is available ??

    Thread Starter KTS915

    (@kts915)

    I am sorry to cause you such a headache but, unfortunately, this does not work for me.

    It is still outputting GMT. In addition, the calendar gif icon I use to go with the time is now not showing, and I am getting the alt label for it instead.

Viewing 15 replies - 1 through 15 (of 21 total)
  • The topic ‘How to use the new prefilled value options?’ is closed to new replies.