I am creating an order form, using HTML, where I need to add a dropdown menu for \'which color\' and a corresponding input field, which will be read-only, for the \'amount\'. Cr
Try this :
Javascript :
function func() {
var option = document.getElementById("color").value;
if (option =='Black')
{
$('#valu').val(100);
}
if (option =='White')
{
$('#valu').val(200);
}
if (option =='Blue')
{
$('#valu').val(300);
}
if (option =='Green')
{
$('#valu').val(400);
}
if (option =='Orange')
{
$('#valu').val(500);
}
};
JSFiddle