I would like to upload text to a db and give users the option
to upload associated files on the same form. If they choose to
upload a file by using the cffile tag file selector (file1), I need
to require them to select a file type from a cfselect tag (type1)
to route the file to its proper desitination of the server. The
problem is that if I make the type1 field required, I can't submit
the form without selecting a type even though their is no file to
upload. If type1 isn't required, the file won't be uploaded to the
proper directory.
My thought is to make the type1 field required only if a file
is selected by the user using the onchange attribute. How can I do
this? or is their a better way still using client-side validation?
Thanks for your help.