[Solved] How to make a text box change depending on a dropdown menu


This code shows how you can accomplish what you seek.
As others have mentioned, it’s not exactly the most secure / efficient way to do this, especially if you’re dealing with real money, but all you have to do to get this to work is add jquery to your html file with <script src="http://code.jquery.com/jquery-latest.min.js"></script>

$('#myPRODUVTS').on('change', function() {
 fruit = $(this).val();
    if (fruit == 'Apple') {
        $('#Price').val('£0.45');
    }
    if (fruit == 'Orange') {
        $('#Price').val('£0.50');
    }
    if (fruit == 'Mango') {
        $('#Price').val('£0.65');
    }
});

http://jsfiddle.net/LtBh6/ this shows the code in action with your example.

4

solved How to make a text box change depending on a dropdown menu