How to get selected value from <oj-select-one>?


Osama Alpha

I have an oj-select-one component with the following definition:

<oj-select-one id="select1" style="max-width:20em" 
                 options={{data3}}
                 value="{{data3.Id}}"
                 options-keys="{{optionKeys2}}" >
</oj-select-one>

In the js file, optionkeys are

self.optionKeys2 = {value:"Id", label:"CourseName"}; 

I want to get the selected id and store the value in a var how to achieve it?

Rays

You need to define a new observable for this.

<oj-select-one id="select1" style="max-width:20em" 
             options={{data3}}
             value="{{selectedValue}}"
             options-keys="{{optionKeys2}}" >
</oj-select-one>

JS

self.selectedValue = ko.observable();
self.optionKeys2 = {value:"Id", label:"CourseName"}; 

Related


How to get selected value from select component

Rafael Augusto How to get selected value from select component? select.component.ts: export class PfSelectComponent implements OnInit { constructor() { } ngOnInit() { } @Input() options : Array<Object>; } select.component.html <select [(ngModel)]=

How to get selected value from <select>

blow I try to get value from select area using form and $_Post. I've browsed through many older questions, and sure enough, I followed the directions. Still I get the error: Undefined array key 'platform'. <form action="" method="POST"> <select name="

How to get selected value from select component

Rafael Augusto How to get selected value from select component? select.component.ts: export class PfSelectComponent implements OnInit { constructor() { } ngOnInit() { } @Input() options : Array<Object>; } select.component.html <select [(ngModel)]=

How to get selected value from select component

Rafael Augusto How to get selected value from select component? select.component.ts: export class PfSelectComponent implements OnInit { constructor() { } ngOnInit() { } @Input() options : Array<Object>; } select.component.html <select [(ngModel)]=

How to get selected value from <select>

blow I try to get value from select area using form and $_Post. I've browsed through many older questions, and sure enough, I followed the directions. Still I get the error: Undefined array key 'platform'. <form action="" method="POST"> <select name="

How to get selected value from <select>

blow I try to get value from select area using form and $_Post. I've browsed through many older questions, and sure enough, I followed the directions. Still I get the error: Undefined array key 'platform'. <form action="" method="POST"> <select name="

How to get selected value from select box in angularjs

Sharmavikram Hello everyone I'm trying to get option value from select box on button click but it shows undefined in console. The option value comes from the server Here is my HTML code <div class="form-group"> <label class="control-form" for="cityid">

How to get selected value from ionic 4 ion-select

Amit Namdeo I am trying to get the selected 'value' from 'ion-select', but when i select any value from 'ion-select', as a newbie to 'ionic 4', i am getting 'indeterminate value' and i can't Sort it yourself. <ion-item> <ion-label>Country</ion-

How to get selected option value from select inside div

zabi I have the following html code <div id="BrokersList4ServiceEndWrapper"> <select id="BrokersList4ServiceEnd"> <option value="1">s1</option> <option value="2">s2</option> </select> </div> I tried Set the selected value to 1. Get the value of the

How to get selected value from select to another component?

Anaya Dream I have this select component and their values are taken from useEffect data. In this component, I can see in the console fromselect const SelectName = () => { const [value, setValue] = useState(0); const [names, setNames] = useState([]); cons

How to get selected value from ionic 4 ion-select

Amit Namdeo I am trying to get the selected 'value' from 'ion-select', but when i select any value from 'ion-select', as a newbie to 'ionic 4', i am getting 'indeterminate value' and i can't Sort it yourself. <ion-item> <ion-label>Country</ion-

How to get selected option value from select inside div

zabi I have the following html code <div id="BrokersList4ServiceEndWrapper"> <select id="BrokersList4ServiceEnd"> <option value="1">s1</option> <option value="2">s2</option> </select> </div> I tried Set the selected value to 1. Get the value of the

Get selected value from form.select

Stanislav Ivannikov I have 2 models - project and todo, the project contains many todos. I'm trying to write a form that will add a todo on a specific item selected in the todo. Unfortunately I get an error No item found with 'id'= from todos_controller when i

Get selected value from form.select

Stanislav Ivannikov I have 2 models - project and todo, the project contains many todos. I'm trying to write a form that will add a todo on a specific item selected in the todo. Unfortunately I get an error No item found with 'id'= from todos_controller when i

javascript - get selected value from select list

I do I get a form with a select form element. <select id="month" name="month"> <option value="Jan">Jan</option> <option value="Feb">Feb</option> <option>Mar <option>Apr <option>May <option>Jun <option>Jul <option>Aug <option>Sept <option>Oct <option>Nov <optio

Get selected value from form.select

Stanislav Ivannikov I have 2 models - project and todo, the project contains many todos. I'm trying to write a form that will add a todo on a specific item selected in the todo. Unfortunately I get an error No item found with 'id'= from todos_controller when i

javascript - get selected value from select list

I do I get a form with a select form element. <select id="month" name="month"> <option value="Jan">Jan</option> <option value="Feb">Feb</option> <option>Mar <option>Apr <option>May <option>Jun <option>Jul <option>Aug <option>Sept <option>Oct <option>Nov <optio

How to get the value of the selected option in a select box

giff if I want to show an alert with a checked option, but my form doesn't see the popup alert. Here is my PHP: <select class="form-control" id="status_users"> <option>All</option> <option>Active</option> <option>Inactive</option> <option>Try</option>

How to get the value of the selected option in a select box

giff if I want to show an alert with a checked option, but my form doesn't see the popup alert. Here is my PHP: <select class="form-control" id="status_users"> <option>All</option> <option>Active</option> <option>Inactive</option> <option>Try</option>

How to get the value of the selected option in a select box

giff if I want to show an alert with a checked option, but my form doesn't see the popup alert. Here is my PHP: <select class="form-control" id="status_users"> <option>All</option> <option>Active</option> <option>Inactive</option> <option>Try</option>

How to get the value of the selected option in a select box

giff if I want to show an alert with a checked option, but my form doesn't see the popup alert. Here is my PHP: <select class="form-control" id="status_users"> <option>All</option> <option>Active</option> <option>Inactive</option> <option>Try</option>

How to get the value of the selected option in a select box

giff if I want to show an alert with a checked option, but my form doesn't see the popup alert. Here is my PHP: <select class="form-control" id="status_users"> <option>All</option> <option>Active</option> <option>Inactive</option> <option>Try</option>

How to get selected option value in Select dropdown

username How to get selected option value in jQuery's select dropdown <select> <option value="100">one</option> <option value="263">two</option> <option value="500">three</option> <option value="768">four</option> </select> The opt

How to get the value of the selected option in a select box

giff if I want to show an alert with a checked option, but my form doesn't see the popup alert. Here is my PHP: <select class="form-control" id="status_users"> <option>All</option> <option>Active</option> <option>Inactive</option> <option>Try</option>