so 4 or none, is that right?
then ur conditions must be wrong.
post them and we can take a look.
Welcome to the Tectite Forums! You can download and get support for our free PHP FormMail (form processor) and other free software.
I've got my form working perfectly with file upoads, renaming the files etc. The problem is that it only works as long as file uploads option is used. I have four file upload fields. I need the user to be able to use the form with the option to upload either no files at all or any number of files up the four maximum. At the moment, the form only works when using all four file upload options. I have no 'required' hidden field. The hidden fields I am using are:
good_url
bad_url
conditions1
conditions2
conditions3
conditions4
MAX_FILE_SIZE
file_names
so 4 or none, is that right?
then ur conditions must be wrong.
post them and we can take a look.
Yeh, it's four file uploads selected, or the form doesn't work at all.
Here are the conditions:
<input name="conditions1" type="hidden" id="conditions1" value=":@
@TEST@first_file~/^.*\.(pdf|jpg|jpeg|gif|png)$/i@You can only upload PDF or graphics files@" />
<input name="conditions2" type="hidden" id="conditions2" value=":@
@TEST@second_file~/^.*\.(pdf|jpg|jpeg|gif|png)$/i@You can only upload PDF or graphics files@" />
<input name="conditions3" type="hidden" id="conditions3" value=":@
@TEST@third_file~/^.*\.(pdf|jpg|jpeg|gif|png)$/i@You can only upload PDF or graphics files@" />
<input name="conditions4" type="hidden" id="conditions4" value=":@
@TEST@fourth_file~/^.*\.(pdf|jpg|jpeg|gif|png)$/i@You can only upload PDF or graphics files@" />
<input name="MAX_FILE_SIZE" type="hidden" id="MAX_FILE_SIZE" value="60000" />
<input name="file_names" type="hidden" id="file_names" value="first_file=Name.%'-file1'%.%2E%.%ext(first_file)%, second_file=Name.%'-file2'%.%2E%.%ext(second_file)%, third_file=Name.%'-file2'%.%2E%.%ext(third_file)%, fourth_file=Name.%'-file2'%.%2E%.%ext(forth_file)%" />
ok, so ur conditions basically say that "first_file" must have a particular pattern, AND "second_file" must have a particular pattern, and so on.
so, if one of them doesn't, then error...
the way to fix this is with the IF feature in conditions.
e.g.
which says: if first_file has been filled in (has a value), then it must match the pattern, otherwise OK. if has been filled in and doesn't match the pattern, display error.HTML Code:<input name="conditions1" type="hidden" id="conditions1" value=":@ @IF@first_file@first_file~/^.*\.(pdf|jpg|jpeg|gif|png)$/i@@You can only upload PDF or graphics files@" />
Spot on! That works a treat! Thanx for all your help.
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks