Autofill a custom field based on the answer a user selects in previous field
Hi,
I would like to autofill a custom field based on the answer a user selects in previous field.
For example, if the user selects "Business A" from a drop down list in "custom field 1", I would like "custom field 2" (in this case its business A's address) to have the correct answer automatically selected/filled out for them.
I also don't want to let the user change this field.
I am working on learning php right now, but I do know a bit of logic from other programming languages so I am also including some pseudo code of what I think I need. (Granted I don't even know what file I would modify to do this)
------
IF ( get_post_meta($post->ID, 'custom_field_1', true) = "Business A" )
{ custom field 2 = "Business A's Address" }
Else IF ( ect)