TOPIC:

Select cities by country 7 months 1 day ago #239198

  • 1987Jan
  • Offline
  • Senior Breezer
  • Senior Breezer
  • Posts: 88
  • Thanks: 0
Das ist klar :)

Wie ich oben im Script sehe, ist New York, Los Angeles abhängig von "usa". Und Berlin, Frankfurt, München ist abhängig von "germany".

Aber wenn ich nun die passenden Straßen zu den jeweiligen Ort als dritte Auswahlliste erstellen möchte, muss ich ja die Abfrage "Ort? Dann Die Str." hinterlassen.

Ich hoffe man kann das verstehen :(

Please Log in or Create an account to join the conversation.

Select cities by country 7 months 1 day ago #239199

  • mihaela
  • Offline
  • Developer
  • Developer
  • Posts: 3128
  • Karma: 105
  • Thanks: 415
Hello again,

I hope that we can continue in English since we don't have a German-speaking support staff member at the moment.

Could you please explain what you were trying to say because I am not sure that I've understood you properly.

Regards,

Mihaela

Please Log in or Create an account to join the conversation.

Select cities by country 7 months 1 day ago #239202

  • 1987Jan
  • Offline
  • Senior Breezer
  • Senior Breezer
  • Posts: 88
  • Thanks: 0
In diesem Scripte steht dass man eine Auswahliste hat (USA, Germany.) Dann soll die zweite Auswahl "0" sein und der Inhalt in der ersten Array ist dann "Texas" und co.

Nun muss eine dritte Auswahlliste vorhanden sein. Mit Straßen.
Wenn ich das wie im Scripte mache, dann muss ich ja die Städte und Dörfer in eine neue Liste machen (also wäre das ja doppelt).

Ich möchte gerne nur eine dritte Auswahlliste die "prüft" bei der Stadt/den Dorf, was da steht und dann kommt die Straße. Aber Sie kann die Stadt nicht prüfen, weil der Inhalt ja "0" sein soll.

marko.bosnjak wrote: Hello,

I've created an example for you.
Create 2 select lists. The first should be named "country" and the second "city". The first has values:

1;Select Country;none
0;USA;usa
0;Germany;germany
The second list has only "0" inserted.
Now go to the "country" element > Advanced tab > Actionscript > Type > Custom > Actions > Change and use this code in the framework:
function ff_country_action(element, action)
{
    var city = ff_getElementByName('city');

    var usaArray = new Array(
        'New York', 'Los Angeles', 'Chicago', 'Houston', 'Phoenix', 'Philadelphia',
        'San Antonio', 'San Diego', 'Dallas', 'San Jose', 'Austin', 'Denver',
        'Las Vegas', 'Seattle', 'Miami', 'Washington', 'Sacramento', 'Other'
    );
    var germanyArray = new Array(
        'Berlin', 'Frankfurt', 'München', 'Köln', 'Frankfurt am Main', 'Stuttgart',
        'Düsseldorf', 'Dortmund', 'Essen', 'Leipzig', 'Bremen', 'Other'
    );
    if (element.value == 'none') {
        // drop cities
        while (city.options.length > 0)
            city.options[city.options.length-1] = null;
    } else {
        // get the matching array
        var selectedArray = eval(element.value+'Array');

        // drop supernumerous option
        while (selectedArray.length < city.options.length-1)
            city.options[city.options.length-1] = null;

        // add the new options
        city.options[0] = new Option('Select City', 'none', true, true);
        for (var i=0; i < selectedArray.length; i++)
            city.options[i+1] =
                new Option(selectedArray[i], selectedArray[i]);
    }
}
Simply add more cities in the arrays between single quotes.
I will attach you the form. Install it and test it out.

Regards,
Marko

Please Log in or Create an account to join the conversation.

  • Page:
  • 1
  • 2
Moderators: ForumSupport
Time to create page: 0.046 seconds

BreezingForms Pro 1.4.7 for WordPress Released!

Available in the membership section.

Summer Sale!

Massive discounts on all subscriptions!

Get Your Subscription Here

Quick Links

Downloads

BreezingForms

ContentBuilder

BreezingCommerce

Templates

Documentation

BreezingForms

ContentBuilder

BreezingCommerce

Apprendre BreezingForms (French Community)

Apprendre et maîtriser BreezingForms par des tutoriels et exemples, le tout en français

breezingforms.eddy-vh.com

Questions et réponses sur les forums de l'AFUJ

AFUJ

Special Offer

Summer Sale! All subscriptions at a special price!

Includes prio support, all of our current and future Joomla!® extensions and Joomla!® templates for the duration of your membership.

Get it from here

3rd Party Discount - 25% Off

We help you to keep your costs under control. If you are a new member and purchased a form building tool from a different form vendor, then you'll get a 25% discount on our subscription plans.

How to receive the discount:

Send us a quick email to sales@crosstec.org with a proof of purchase (for example a paypal receipt), await payment instructions and enjoy your membership!