Highlighted

Canvas Combobox Component how to set Values with Javascript

Participant ,
Mar 02, 2020

Copy link to clipboard

Copied

I want to set the values for a HTML5/Canvas Component Combobox with Javascript. I know how to set the values with the component window, but I need a programatic solution.

 

I have got a solution to append a value and text.

 

$('#combo1').
append($("<option/>").
attr("value",'No 1').
text('Jimi Hendrix'));

 

This page helped me

https://techbrij.com/jquery-operations-on-dropdownlist-combobox

 

Even if I want to set new Values und delete the former values I can use this script:

 

var str = "<option value='0'>Hund</option><option value='1'>Katze</option>";
$('#combo1').html(str);

 

TOPICS
Code, How to

Views

110

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more

Canvas Combobox Component how to set Values with Javascript

Participant ,
Mar 02, 2020

Copy link to clipboard

Copied

I want to set the values for a HTML5/Canvas Component Combobox with Javascript. I know how to set the values with the component window, but I need a programatic solution.

 

I have got a solution to append a value and text.

 

$('#combo1').
append($("<option/>").
attr("value",'No 1').
text('Jimi Hendrix'));

 

This page helped me

https://techbrij.com/jquery-operations-on-dropdownlist-combobox

 

Even if I want to set new Values und delete the former values I can use this script:

 

var str = "<option value='0'>Hund</option><option value='1'>Katze</option>";
$('#combo1').html(str);

 

TOPICS
Code, How to

Views

111

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Mar 02, 2020 0
Participant ,
Mar 02, 2020

Copy link to clipboard

Copied

I have got a solution to append a value and text.

 

$('#combo1').
append($("<option/>").
attr("value",'No 1').
text('Jimi Hendrix'));

 

This page helped me

https://techbrij.com/jquery-operations-on-dropdownlist-combobox

 

Even if I want to set new Values und delete the former values I can use this script:

 

var str = "<option value='0'>Hund</option><option value='1'>Katze</option>";
$('#combo1').html(str);

 

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Mar 02, 2020 0