RE: Autofill field contact
Hi partner,
For "If else" between fields on the form, we could use business rules to achieve it.
I will provide you with specific steps.
Here I have these two fields on the Contact form.
Go to Advanced Find > Customizations > Customize the System, expand Entities > Contact > Business Rules. New a business rule.

First select the scope in the upper right corner, which determines which forms the business rule will work on.

Set the condition.

Then add an action that Set Default Value.

Add another condition.

Then add an action that Set Default Value.

IF
Gender equals "Male"
THEN
Set default value of Salutation to "Mr"
ELSE IF
Gender equals "Female"
THEN
Set default value of Salutation to "Ms"
Finally save and publish.
Please note that in business rules you should choose Set Default Value instead of Set Field Value.