How can I set default selected country as USA in dropdown?

Bhadresh Panchal asked on July 12, 2018 14:06

I created the Alternate Form among one Field AddressCountryID set form Control as 'Country Selector'.

So, How can i set the default selected country as 'USA' in Dropdown?

Thanks.

Correct Answer

Bhadresh Panchal answered on July 12, 2018 15:24

Hi Friends,

Thanks for your quick feedback.

It's very simple that you can set the drop down value you have bonded as default value.

For example: Text: USA (Value: 271) then simply set 271 as default value property will resolved it.

Regards, Bhadresh Panchal

0 votesVote for this answer Unmark Correct answer

Recent Answers


Dragoljub Ilic answered on July 12, 2018 14:22 (last edited on July 12, 2018 14:23)

Hi Bhadresh,

If you configure field to be Text, when you select Country selector as Form control and bellow that click on arrow Advanced, you can configure return value to be String with separated values. When you configure it like that, you can simply add usa as default value on the field.

Best regards, Dragoljub

1 votesVote for this answer Mark as a Correct answer

Peter Mogilnitski answered on July 12, 2018 14:23 (last edited on July 12, 2018 14:23)

I guess the easiest way would be to use jQuery: $("div.country-selector select").val("USA");

P.S. Don't forget to uncheck Add (select country) record on the first position in the control settings

0 votesVote for this answer Mark as a Correct answer

vasu yerramsetti answered on July 12, 2018 15:28

@Bhadresh,

Try this:

  1. Change from Country selector form control to Drop down list form control
  2. Write Query like below

    SELECT TOP 1 CountryThreeLetterCode,CountryName FROM CMS_Country Where CountryThreeLetterCode='USA' UNION SELECT CountryThreeLetterCode,CountryName FROM CMS_Country Where CountryThreeLetterCode<>'USA'

0 votesVote for this answer Mark as a Correct answer

   Please, sign in to be able to submit a new answer.