Yes it is possible. If the information is on the server side you will need to ajax
and in the select
you will need to listen to the event change
.
Ajax is a tool/method for communicating between the browser and the server. You can pass information to the server and ajax waits for the answer and runs a function when you receive it.
To trigger the ajax you need an Event Handler. A listener that detects when the select changes, when it makes a choice. Then, within this function you can make the ajax request.
For example:
$('#selecao').on('change', function(){
var data = { opcao: $(this).val()};
$.ajax({
url: url,
data: data,
success: function(respostaServidor){
$("#resposta").html(respostaServidor); // mero exemplo
}
});
});
Then you need the server side to listen to this request with for example (assuming that PHP is the server-side language):
$opcao = $_GET["opcao"]; // guardar os dados do ajax numa variável
// depois precisa de fazer uma query à base de dados,
// aqui varia conforme o que tem no servidor e precisa precisar melhor na pergunta
// Depois da query à base de dados (ou ficheiro) pode retornar o valor com por exemplo:
echo $dados; // enviar resposta de volta para o lado do cliente
you want to do this by selecting the option or when passing the mouse over?
– Erlon Charles
when selecting..
– ivan veloso
Where profile information is stored?
– abfurlan