Correct casing before inserting to db

  • studiomundo
    Asked on June 30, 2015 at 9:02 AM

    Hi,

    All e-mail address must be written in lowercased, but some people insist on typing capitalized. At other times, customer claim that I write their name in lowercased. Since all of this data comes from the client.

    How do I apply a filter before inserting into the database?

     

    example:

    emails [chars to convert all lower case]

    name [convert to first letter in uppercase]

  • Elton Support Team Lead
    Replied on June 30, 2015 at 12:05 PM

    How are you saving the submissions in to your database? If you are using custom script to capture the form data via HTTP Post, you can define on your script to correct the casing on that fields. 

    However, if you are relying on the email data, you can capitalize the first letter of every field value by following this guide: https://www.jotform.com/help/162-Capitalizing-the-First-Letter-of-Every-Word-of-the-E-mail-Response

    For the lowercase conversion, you can still do this in your form notification by wrapping the field variable with the following code. e.g. if your email field variable is {email}, it will look like this:

    <span style="text-transform: lowercase;">{email}</span>

    To do this, you have to open the HTML editor on your form notification. Find the email variable and insert the above code. If the email variable is already wrapped with span tag, just add only the text in bold.

    Correct casing before inserting to db Image 1 Screenshot 20

    If you need further help with this, let us know.

    Regards!