• Welcome to WebsiteBaker Community Forum. Please log in or sign up.
Welcome, Guest
News
Support WebsiteBaker
Your donations will help to:
PayPal
  • Pay for our dedicated server
  • Pay for domain registration
  • and much more!
You can donate by clicking on the button below.

Mpform with smileys and emojis

Started by netraam, January 18, 2023, 09:41:39 PM  ( Read 12,235 times )

netraam

Hello,

i'm using Mpform for several years. now I have version 1.3.22.
Tha last couple of years the people are using more and more smileys and emojis.
But when they send a form with a emojis Mpform can't save it to the database it just sends me an email.
Is there a simple solution for this? I dont mind if the smiley disapear I just want it to save the form in the database.

thanks in advance
Maarten

    Gast

    what is the collation for the mpform-database-tables? Emoji's need utf8mb4. Maybe, thats the solution, but i've never use emoji's in a formular

      hgs

      The current version of mpForm is  1.3.43  and available for download here


      But the current versions are also adapted to the current php version and the current WebsiteBaker Version
        LG Harald

        "Fange nie an, aufzuhören - höre nie auf, anzufangen." Marcus Tullius Cicero (106-43 v.Chr.)

        "Never begin to stop - never stop beginning." Marcus Tullius Cicero (106-43 BC)

        mrbaseman

        Is the problem still there, when you swith to the latest version of mpform? Can it be solved by converting the database tables? (make a backup before running experiments...)

          netraam

          In the meantime i found a solution.
          I've added a section to the page of the mpform.
          The extra section is a code module where i've wrote a script that remove all Non-ASCII characters from my large textfield (in my case field #7).
          The script is executed when you click on the send button.

          echo "<script>
          $('.mpform_submit').on('click', function () {
           removeInvalidChars();
          });

          function removeInvalidChars() {
           var str = $('#field7').val();
           str = str.replace(/[^\x20-\x7E]/g, '');
           $('#field7').val(str);
          }
          </script>"
          ;

            \n\n