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 7717887
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T03:01:07+00:00 2026-06-01T03:01:07+00:00

I want to say hello to the stackoverflow community. I’ve just started using knockout

  • 0

I want to say hello to the stackoverflow community.

I’ve just started using knockout a few days ago.

Right know I’m using it to make a dynamic menu builder for a CMS I’m working on.

Here is the code: http://jsfiddle.net/dnlgmzddr/HcRqn/

The problem is that when I choose an element from the select box, the input field update as I expect, but the observable doesn’t reflect the change. Because of that, the add button is not enabled.

What am I missing? How can I fix it?

Thank you.

  • 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-01T03:01:09+00:00Added an answer on June 1, 2026 at 3:01 am

    When you populate the url field, you would need to trigger the change event to get the observable to be upated. So, you could do:

    $("#url").val('/pages/' + id).change(); 
    

    Another option though that is more in the Knockout spirit is to use a binding on your select. In this case, you would likely want to populate an observable with that value, then use a manual subscription to default the formatted value into the input field.

    this.itemUrl = ko.observable();
    this.selectedUrl = ko.observable();
    this.selectedUrl.subscribe(function(newValue) {
        if (newValue) {
            this.itemUrl("/pages/" + newValue);                
        }
    }, this);
    

    Then, bind your select to selectedUrl:

        <select id="pagedList" data-bind="value: selectedUrl">
            <option value=""><option>
            <option value="test">Test</option>
        </select>
    

    Here is a sample: http://jsfiddle.net/rniemeyer/HcRqn/21/

    You could also eliminate the extra observable and manual subscription if the “value” of your options was the url.

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

Sidebar

Related Questions

Say I have a vector: (def data [Hello World Test This]) And I want
Say, I have a string hello is it me you're looking for I want
First off I want to say that I am not using threads or multiple
I've a string (let's say Hello World) and I want to save the first
Hello everyone and thank you for your time. I would just like to say
I have a string say Hello! world! I want to do a trim or
At first I want to say: I couldn't find a support forum for this
First thing i want to say that it's not an easy question to explain,
First off i want to say im attempting (and mostly succeeding) to use purely
This is probably a simple where clause but I want to say, from columnX

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.