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条)

报告相同问题?

悬赏问题

  • ¥15 如何用stata画出文献中常见的安慰剂检验图
  • ¥15 c语言链表结构体数据插入
  • ¥40 使用MATLAB解答线性代数问题
  • ¥15 COCOS的问题COCOS的问题
  • ¥15 FPGA-SRIO初始化失败
  • ¥15 MapReduce实现倒排索引失败
  • ¥15 ZABBIX6.0L连接数据库报错,如何解决?(操作系统-centos)
  • ¥15 找一位技术过硬的游戏pj程序员
  • ¥15 matlab生成电测深三层曲线模型代码
  • ¥50 随机森林与房贷信用风险模型