Click to See Complete Forum and Search --> : form validation problem with file field


yona_t
07-02-2008, 08:45 AM
Hi,
I am facing this little problem... I have this form with 4 fields (three of them text fields and one is input type=file). I use the form for editing content in a database. All fields inthe form are compulsory and when I load the form for editing some piece of content the file input area is blank (I have put a link below it to show the file that hass been uploaded). The problem is that when i click the return button i have in the form the validation function wont let me procceed in the system because of the blank file field... any idea how this can be solved?

Thnx in advance
Yona T

gabriele
07-02-2008, 09:49 AM
you can not programmaticaly add a value to a file field because it creates a security breach ..

think about it .. you visit my webpage and i put into a file field a value that corresponds to a file on your computer where the system passwords are stored and then autosubmit the form which emails me your file ... not a good scenario ehh ?

you most likely should have two fields one of file type (not compulsory) and one of text that is updated when the file field changes value..

this second field is the one that should be compulsory and is also the one that should be populated when loading data from the database..


hope this makes some sense ..