Forums

Not to loose content of "file upload" field after captcha

MaherFattah 29 Mar, 2011
I am using chronoforms v4. In an Arabic learning joomla site, I created an input form that contains deferent input fields with one of them as Upload file and one Captcha field.
The data is saved directly into database.

Every thing is working fine except one issue in file upload field.

Following is a link to a small test form that I generated using the form wizard to show the issue.

http://goalex.cloudaccess.net/index.php?option=com_chronocontact&chronoformname=Test

My issue description:

If user entered all data correctly but entered a wrong captcha field he gets an error message informing him to re-enter the Captcha field.

I do not need the use to loose his entered data after receiving the error message, that is why I used the parameter of "Try to Republish" in the general tab of the form.

The problem is that all old entered data did not disappear except the file name to be uploaded.

I need help so that the field contents of the file name does not disappear after the error message and is handled the same as the rest of fields.

Regards, Maher
GreyHead 30 Mar, 2011
Hi Maher,

This is a browser "security" feature to stop accidental file uploads. You might be able to work around it with JavaScript but I think that most browsers just ignore any value attribute for a file input.

Bob
MaherFattah 30 Mar, 2011
Thank you Bob for your quick response.

My original chrono form contains 20 fields of type "File Upload" for uploading a maximum of 20 photos of a real stat unit. It would be very difficult for the visitor to re- enter information for the 20 fields in case of captcha failure.
Actually I am a Joomla user and a weak programmer.

I would appreciate if any one can help me by supplying an example of the required JavaScript for one field and I will duplicate that for the rest of the fields.
GreyHead 30 Mar, 2011
Hi MaherFattah,

I'll have a look when I have a moment - a bit busy with new releases at the moment.

It might be simpler to make this a two step form; put the anti-spam on the first step to block the spammers and then the file uploads on the next step.

Bob
This topic is locked and no more replies can be posted.