Losing Files Selected For Upload After Entering Wrong Recaptcha Coderecaptcha
Posted 08 December 2012 - 05:14 PM
I have a form which collects information from a user, it also has an option to upload files. I placed a recaptcha control on the form to avoid bots. However the problem is i have many fields on the form which are lost if i give a wrong captcha.
I'm using hidden fields to store input values, so if user enters wrong captcha i'm restoring field values from the hidden fields, however i don't know how this can be done if the input type is file. Is it possible to store file info in the hidden field too, is yes how?
at the moment it is major problem if user enters wrong code after selecting some files.
Thanks for any input..
Posted 08 December 2012 - 06:47 PM
Posted 08 December 2012 - 06:56 PM
Posted 08 December 2012 - 10:18 PM
That is pretty much the only way to handle it. There is no way to re-populate a file input or anything similar.
Did I help you out? Feeling generous? I accept tips via Bitcoin @ 14mDxaob8Jgdg52scDbvf3uaeR61tB2yC7
Posted 09 December 2012 - 06:02 AM
Should the test fail, then regenerate it (using the server-side code), replace it (with the JS-code), and stop the form from posting.
0 user(s) are reading this topic
0 members, 0 guests, 0 anonymous users