Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

HTML5 Canvas - Combobox clear values

Engaged ,
Apr 05, 2022 Apr 05, 2022

I have a combobox which is dynamically populated via JQuery AJAX with JSON.

 

How do I clear the values of that combobox to refesh it for new values?

 

 

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

correct answers 1 Correct answer

Engaged , Apr 07, 2022 Apr 07, 2022
Translate
Engaged ,
Apr 05, 2022 Apr 05, 2022

I have tried in the following code:

 

$('#patients_cbx').prop('selectedIndex',0);

 

and also

 

$('#patients_cbx').val('');

 

I cannot find any reference from Adobe on doing this or a lot of other seemingly simple things...most frustrating!

 

		$.ajax({
			type: "POST",
			url: 'scripts/get_patients.php',
			dataType: 'json',
			data: {
				complexity: complexity
			},
			success: function (data) {
				$('#patients_cbx').prop('selectedIndex',0);
				console.log(complexity);
				for (var i = 0; i < data.length; i++) {
					$('#patients_cbx').append($("<option/>").attr("value", data[i].data).text(data[i].label));
				}
			}
		});
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Engaged ,
Apr 06, 2022 Apr 06, 2022

An answer on this question please?

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Engaged ,
Apr 07, 2022 Apr 07, 2022
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Apr 08, 2022 Apr 08, 2022
LATEST

you're welcome.

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