• Got an optional url field, but when left blank by the user the form tag ends up in the email.

    <label> Website Link (URL)
    [url cdsn-link] </label>

    Ends up as:

    Website Link (URL):
    [cdsn-link]

    Um, either leave it blank or allow a default if left blank i.e. “N/A”, but to be very clear on this I am not talking about a form field placeholder default like [url field “https://”%5D, as that requires a user to backspace to clear the field or fails validation if left as is.

    Did I miss something in the docs?

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author Takayuki Miyoshi

    (@takayukister)

    Where can we see the site? How have you set up in the Form and Mail tabs?

    Thread Starter jgoldbloom

    (@jgoldbloom)

    Your response leads me to believe you might be thinking the form tag [cdsn-link] always displays in the email, regardless of the user submitted value.

    To clarify, the tag only shows in the email if the url field is optional and the user leaves it blank. Meaning if the user enters a valid url and submits, the url correctly displays in the email.

    I already copy/pasted the exact relevant form template setup plus the exact email result which means the mail template is the same. It’s a very simple setup and all you need.

    Please address this issue.

    On a side note, you might consider these feature requests related to this issue:

    • Add another url field type option “emptyValue: foo” where foo is text that displays in the email if the optional field is left blank when submitted, i.e. [url cdsn-link emptyValue:”None” default:”https://”%5D
    • Notice in that example I used the default option as well, the concept is to show the default value within the input tag, but (and this is key) if the submitted value exact matches the default value, display in email the emptyValue instead.
    • If also specifying a placeholder then use that input tag attribute instead of the “default” input tag attribute your plugin is generating which is NOT the same thing! I checked your form html rendered to the browser to confirm this is indeed happening. Major mis-understanding on your part, the placeholder displays to the user within the input field but should disappear when they start typing and never be submitted with the form as that’s the intended purpose of the default attribute.
    • This reply was modified 7 years, 10 months ago by jgoldbloom. Reason: formatting and clarification
Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Blank optional url field shows tag in email’ is closed to new replies.