如何制作WebForm，因此当用户选择国家/地区时，我们将在列表中显示列表中的列表中的状态 当其他国家它将展示省份作为TextEdit也是强制性的。 我不想用jQuery乱画，并隐藏导致多个字段的控件
How can I make a webform so when a user selects the country US it will show the states in a list with a mandatory select from list and when other countries it will show Province as textedit also mandatory.. i don't want to mess arround with Jquery and hide the controls resulting into multiple fields
If you're not fond of installing a pretty big module as location, have a look at conditional fields which allows you to do what you need.
Conditional Fields allows you to manage sets of dependencies between fields. When a field is xe2x80x9cdependentxe2x80x9d, it will only be available for editing and displayed if the state of the xe2x80x9cdependeexe2x80x9d field matches the right condition. You can, for example, define a custom xe2x80x9cArticle teaser" field that is shown only if a "Has teaser" checkbox is checked.
So set up a select list of counties and if US is selected show the "states list" that would be hidden otherwise.
addressfield module does that perfectly.
What I don't like about it is that it will also show "address 1&2" fields. You can hide those with css. When you output the field it will show the complete address. You can also hide the parts you don't need with css.