function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
community Name.ax928community Name.ax928 

make the field required when the checkbox is unchecked

Hi to everyone,

 

i have one scenario on lead conversion vf page,

 

i have a field called 'donotcreatetaskuponconversion' default value value set to true. and i have 2 more fields 'status, priority'.

 

when i uncheck that checkbox i need status and priority will be required( i need the required banner next to that field).

 

i written the code like this,

 

 <apex:inputField value="{!task.status}" required="if{donotcreatetaskuponconversion=false}" />

  <apex:inputField value="{!task.priority}" required="if{donotcreatetaskuponconversion==false}" />

 

can anyone help me out on this

or 

any sample code.

thanks in advance, 

osamanosaman

call action function on the change of checkbox. Set the required property to true and rerender the fields.

community Name.ax928community Name.ax928

thanks for reply,

 

i tried in that way but i could not able to solve, maybe i am using the wrong functionality.

 

can you please post some sample code if you have.

 

thanks again

Damien_Damien_

Put those inputfields into some sort of container, and force a rerender on them when the button is clicked.

community Name.ax928community Name.ax928

thanks for the reply,

i tried but, may i am doing mistake

if you sugest me some sample code that could be more helpful to me.