dsavz66262 2013-04-17 11:28
浏览 123
已采纳

如何在某些条件下首先输入值,在第二个文本框中显示值

greeting to all, is there any way to get value in second text box, i have some filed as shown in my image,enter image description here if we type 90 in result text box then automaticaly the value of nor/ab field should be "Low", for 180 should be high. so we have to check over condition for 110-170(range field)...

actualy i am puzzled for the value of range field in the form of 110-170.... Any idea will be appreciated....thanks in advance...

  • 写回答

4条回答 默认 最新

  • dth2331 2013-04-17 11:55
    关注

    Try to do this way:

    var result = $('#result');
    var sel = $('#select');
    
    result.on('keydown keyup', function () {
       if (result.val() < 90) {
          $('option[value="low"]', sel).prop('selected', true);
        } else if (result.val() > 90) {
          $('option[value="high"]', sel).prop('selected', true);
        }
    });
    

    Demo Fiddle

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(3条)

报告相同问题?