+ Start a Discussion

How I can mark Input file tag as Required when submiiting form

Hi ,


I found that required attribute doesn't work with <apex:inputFile />.


I want to put error Message for it to User. I dont want to use javascript as on page other 

fields are also with required attribute. I want to Sync all Error Messages on Page when submitting 

Submit button. 


Other way is to use Apex function to show Message.But I think it is not solution which i want.


Your help will be most appreciated.








There is a required attribute for this field:

requiredjava://java.lang.BooleanA Boolean value that specifies whether this component is a required field. If set to true, the user must specify a value for this component. If not selected, this value defaults to false.

 since it is a java.lang.Boolean you may need to write its value in capital letters.

Here is a link, its very useful, contains the reference for all the apex tags.

Just look for the fileinput tag on the left sidebar to see all its attributes.



I know already that required attribute is given for input file.but it is not working..


you did practical with it .


Thanks for reply.