I'm working on a page where I have a pick-list and based on the selection the user should be allowed to enter depends on the pick-list

so for an example:

Picklist ==> Miles, Days

if the user select Miles then text-box should allows the user to enter the number value

if the user select Days then it should be a date picker

should I have to use apex for the above scenario?

  • In you want it at clint side use jquery or js to change yo type of input the text or numeric. Server side you can check the picklist value and validate data Commented Apr 23, 2015 at 14:51

1 Answer 1


Apex? Not necessarily (though probably). You will definitely need to use Visualforce, however.

You will need to use an action support tag to render either the miles or the days field, depending on the selection. Miles and days will need to be two seperate fields with a 'render' property, then rerender both fields whenever the picklist changes.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .