File Upload Form text - is it posible to set READONLY by javascript

G

Grzegorz ¦lusarek

Hi All. One of the fields used in my form is to upload file, Is is to
posible to made this field readonly and after filling radio field set
this to use by javascript. I don't wanna give a User chance to upload
file until he check in the form that he want's to upload File.
thanks for any help
Gregor
 
E

Erwin Moller

Grzegorz said:
Hi All. One of the fields used in my form is to upload file, Is is to
posible to made this field readonly and after filling radio field set
this to use by javascript. I don't wanna give a User chance to upload
file until he check in the form that he want's to upload File.
thanks for any help
Gregor

Hi,

You cannot do a lot of scripting against a file-upload formelement in
Javascript.
This is intentionally because if scripting was possible, you would be able
to add more files (for example: all kind of systemfiles), and create a
serious securityproblem.

I think the easiest solution for you is using CSS:
1) Place the fileuploadpart in a div that has display:none
2) Once the checkbox is checked, you change this to display=block.

Please note that people who have JS disabled will be left out with the
described solution, because they have no way of making the div visible
again.

Regards,
Erwin Moller
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,432
Messages
2,571,682
Members
48,796
Latest member
Greg L.

Latest Threads

Top