Search code examples
modx

modx: eForm remembering field input on error


After I submit the form unsuccessfully, the form looses all the values I typed in.

I'm using value="", so that could be related, but if I remove it I get a / in the field, and it still doesn't remember

any idea what I could be doing wrong?


Solution

  • Okay, so I figured it out. I had all the intention of going in and adding the functionality, when I came across line 573 in eform.inc.php "# get SESSION data - thanks to sottwell" so it's already doing what I want it to.

    anyhow, because I couldn't find this in any documentation here is what I've done. Though I must say faintly recall doing this exact thing before. So the next time I need this I might come across this :)

    add a value=[+field+]

    <input id="femail" name="email" value="[+email+]" eform="Email Address:email:1" />
    

    just remember that the value needs to match the class and NOT the id(unless you want them the same)