I want to show conditional text at the top of a node add form.

the condition is based on what the user has selected in another content type form.

This is a two stage application form - content types: application-part-1, application-part-2. In the first part they select a location from a list of two, so I want to take this selection and show some conditional text on the second form according to what they selected in the first form.

My initial thoughts are that i should use field_get_items and hook_form_alter to display the text.

Any ideas?

Comments

derek smalls’s picture

before i persuade the client not to do this!

Sam Moore’s picture

If you want to do this in code, then yes I'd probably start with hook_form_alter, or perhaps just some simple logic in the template for the second node type.
Load the user and find their submission for the first content type, then you can get the values they selected. Based on those, you can decide which parts of your form on the second content type page to display.
You might want to move this thread to the module development or theme development support forum to dig deeper.