I have a javascript function that gets the value of the selected item in a combobox, and would like to pass that value as a parameter to a SQL query to bring the data that are related to the value obtained in the selected combobox in my asp page, follows my javascript function and my SQL query.
function obterOpcaoSelecionada(){
//obter o elemento select
var formu = frmDados.cb_catinsumo.value;
//obter o índice da opção selecionada
var indiceSelecionada = elem.options.selectedIndex;
}
SQL code:
SELECT
id_insumo,nome_comercial
FROM
tb_insumo
WHERE
id_catinsumo =
( SELECT
id_catinsumo as id
FROM
tb_catinsumo
WHERE
categoria_insumo ='parametroJavaScritp'
)
ORDER BY
nome_comercial