Tuesday 8 July 2014

Required field using custom controller on VF page.





Hi friends,

Recently i was working on a complex visual-force page, where page has lot of render and reRender.
My requirement is to make some fields mandatory on vf page but page as some javascript and reRender on save button which creates problem while i am making field mandatory using required attribute of <apex:inputfield> tag.

So to solve this problem i have maked field required by using custom controller and field having same look and feel as standard required attribute because i am using same standard CSS which standard inputfield is used on required field attribute.

Here the VF page and controller:-

Screen Shoots:-


Cheers!!!
Anurag Jain