We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 4032
    • 5 Posts
    hi,
    i found a little problem in eform and ive got no idea to fix it.
    if i use eform and submit the form withput filling out the required fields a message will be give out and the fields a fill have the same value.

    if i use quotes the following will be:
    <input type="text" name="city" value=""Dessau"" />


    the text in the quotes will be hidden, so i need to escape the quotes like:
    <input type="text" name="city" value="\"Dessau\"" />


    a snippet like this dont work:
    <input type="text" name="city" value="[[addslashes? &var=`[+city+]`]]" />
    
    [[addslashes]]:
    <? return addslashes($var); ?>
    


    Any Ideas for this Problem?

    PS: modxcms.com has the same problem. look at http://modxcms.com/learn/showcase/?view=submit and fill "test" in the name filed, "test" will be hidden sad
      • 16278
      • 928 Posts
      Use &quot; in the value instead of quote marks
      value=""Dessau""
      This is the proper way to mark up quotes in HTML.
      wink KP
        • 4032
        • 5 Posts
        good morning kp52,
        thanks for your answer.

        but, how it works to tell eform that he had to decode quotes like your example?

        otherwise, i need a workaround for execute snippets on form parsing, so i can to do this:

        <input type="text" name="city" value="[[decodequotes? &var=`[+city+]`]]" />
        
        Snippetcode [[decodequotes]]:
        <? return str_replace('"', '"', $var); ?>
          • 4032
          • 5 Posts
          i looked into the eform.inc.php file and add the following on line 165:

          165: $value = str_replace('"', '"', $value); // added by Jens Wittmann (www.3undzwanzig.com)
          166: $fields[$name]	= stripslashes(($allowhtml || $formats[$name][2]=='html')? $value:$modx->stripTags($value));


          the script works... finally i testing some examples.