Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8159689
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T18:00:24+00:00 2026-06-06T18:00:24+00:00

I have a dynamic dojo form in which I have a dijit.form.Select whose selected

  • 0

I have a dynamic dojo form in which I have a dijit.form.Select whose selected value I have tried to set dynamically through various ways. I get the select widget to load and show the data, but it always ignores my every attempt. I am using dojo 1.7.

        var bcntryval = <?= $this->billingContact->countryId;?>;
    var countryStore;



    function onBillingShow() {
        if (countryStore) countryStore.close();
        countryStore = new dojo.data.ItemFileReadStore({url: 'CartUtilities.php?action=getcountries'});
        dijit.byId("bcntry").setStore(countryStore, bcntryval);  // does not set value! but does set the store
        dijit.byId("bcntry").attr('value', String(bcntryval)); // doesn't set the value either
                    dijit.byId("bcntry").set('value', bcntryval));  // nor does this!
    }

My markup for the bcntry widget is as follows:

<td><input data-dojo-type="dijit.form.Select" style="width: 10em;" data-dojo-props="sortByLabel:false, maxHeight:'-1'" data-dojo-id="bcntry" id="bcntry" name="bcntry" />

I’ve invested a fair amount of time on learning dojo. When it works its nice, but the docs leave a lot to be desired!
I am also seeing a similar problem with the dijit.form.FilteringSelect. That also ignores setting the value via javaScript.
I’ve also tried completely programmatic versions of this code. I have come to the conclusion that setting the value just doesn’t work when you’re selecting from a store.
This DID work, but its not dynamic.

              <div name="scntry" data-dojo-type="dijit.form.Select" data-dojo-props="maxHeight:'-1',sortByLabel:false" value="<?= $this->shippingContact->countryId;?>" >
              <?php foreach($this->countryList as $c):?>
                 <span value="<?= $c->id;?>"><?= $c->name;?></span>
              <?php endforeach;?>         
              </div>
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-06T18:00:26+00:00Added an answer on June 6, 2026 at 6:00 pm

    Take a look here, I believe this does what you want in the Dojo way:

    Setting the value (selected option) of a dijit.form.Select widget

    If not, you can always just use the actual dom selection object and use straight Javascript:

    How do I programatically set the value of a select box element using javascript?

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a dynamic query which I call and I put the Result set
I have a select which needs to have dynamic WHERE CASE conditions. SELECT *
I have dynamic array filled with bytes, which are read from .raw file with
I have set up my coldfusion application to have dynamic urls on the page,
I'm building an application which will have dynamic allocated objects of type A each
I have dynamic select drop-down menus. For example, if you select a specific month,
I have a list of twitter buttons. These are added dynamically and have dynamic
I have a list which contains dynamic data. i.e list[0].id=0; list[1].id=1; list[2].id=2; I want
I have dynamic sql in stored procedure: DECLARE @sql nvarchar(1000) SET @sql = 'UPDATE
I have dynamic and quite large contents which needs to be populated on user

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.