How do I make a select in the database using only using a jQuery? I have two combobox and I want to use their value to make a select in my database:
$.getJSON('/MinhaDoenca/rest/hospital/get', function(data) {
for ( var index in data) {
$("#idHospital").append(
'<option value="'+data[index].nome+'">'
+ data[index].nome + '</option>')
}
});
$.getJSON('/MinhaDoenca/rest/especialidade/get', function(data) {
for ( var index in data) {
$("#idEspecialidade").append(
'<option value="'+data[index].descricao+'">'
+ data[index].descricao + '</option>')
}
});
I would like to take these two values and make a query in my database, but using only jQuery and HTML, without PHP. It's possible? Could someone give me an example? (my database is PostegreSQL)