Get value from dropdown in HTML panel
Hey, i'm trying to get the value from the html dropdown list to the .jsx file. How to achieve it?
index.html:
<select id="select_id" class="btn btn-danger dropdown-toggle">
<option value="0">One</option>
<option value="1">Two</option>
<option value="2">Three</option>
</select>
<select id="select_id" class="btn btn-danger dropdown-toggle">
<option value="0">One</option>
<option value="1">Two</option>
<option value="2">Three</option>
</select>
main.js:
(function () {
'use strict';
var csInterface = new CSInterface();
$('#select_id').on('change', function() {
csInterface.evalScript('test("' + JSON.stringify(this.value) + '")');
});
init();
}());
script.jsx :
function test(str) {
alert(str);
}
By changing the selected options, nothing happens. And this should trigger an alert in photoshop, if I think correctly, but I'm just starting coding ![]()