0

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

2 Answers 2

0

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 “dependent”, it will only be available for editing and displayed if the state of the “dependee” field matches the right condition. You can, for example, define a custom “Article 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.

0

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.

2
  • well this is for D7, and I'm using still the D6 :(
    – PartySoft
    Commented Oct 24, 2011 at 20:31
  • bummer ;-) Try the location module. There was a bug in that module when you switched countries but I heard they recently fixed it.
    – uwe
    Commented Oct 24, 2011 at 20:39

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.