Get value into text field using combobox

Go To StackoverFlow.com

0

I want to get value into text field from database when the value is selected from combo box

p.s: the value in combo box and the value I want into text field come from same table in database

2012-04-05 19:39
by Mohammed Ahsan
You will have to learn some PHP, Javascript and SQL for that - Siblja 2012-04-05 19:41


2

if the value in the select box is the same as the value you want in the text field, you can do this with jQuery:

$("select").on('change',function(){
    $("input").val($("select option:selected").val());
});​

just replace select and input with selectors for those fields, and it's all handled client-side, here's a demo: http://jsfiddle.net/JKirchartz/JwjX3/

2012-04-05 19:47
by JKirchartz
no I want different value into text fiel - Mohammed Ahsan 2012-04-05 20:23
which value you need. @MohammedAhsa - S. S. Rawat 2013-10-21 10:07


0

my friend said that:

$('select').change(function(){
            var t = $('select').val();
            $('input').val(t);            
          });
2013-10-21 09:35
by user2877975
Ads