+ Start a Discussion
RamyaKrishnaRamyaKrishna 

Making fields required based on value from the picklist

Hi,

I have a DynamicVF page with all fields (Through repeater i placed all inputfields on VF page).

Name,Phone__c,City__c (picklistfield), pincode__c.

 

Initially "Name" is only required field. Remaining all are not required fields.

When i choose a 'city' value from the "picklist" i need to make pincode field as required field. (That field should be required with Red symbol )

 

Any help will great appreciation.

 

thanks,

Ramya

 

RamyaKrishnaRamyaKrishna

Hi,

Is it possible above requirement using Apex.Message class?

 

Thanks,

Ramya

Praveen SappatiPraveen Sappati

Hi,

 

To make the pincode field mandatory when you choose 'city' from picklist.

 

for the field 'pincode' in VF page declare 'required="{!var}" and then in controller make the 'var' as 'true or false' based on the required condition.

 

 

Regards,

Praveen Sappati

RamyaKrishnaRamyaKrishna

Hi Praveen,

Thanks for your help.

 

I am working on Dynamic VF page through custom settings.

I placed all the controls dynamically using Repeater tag.

So that i can't apply the condition to the individual field.

So it may not working.

 

Can you please reply another solution.

 

 

Thanks,

Ramya