开发者

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?


well for now I've used a javascript to do this, it works well but maybe someone has a php/modx/eform solution.


By unsuccessfully submitting the form do you mean it fails validation checks?

No matter what I do, I can't replicate the behaviour you are seeing.


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)

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜