V2EX = way to explore
V2EX 是一个关于分享和探索的地方
Sign Up Now
For Existing Member  Sign In
86322989

一个 html select 的操作,我特么竟然搞了 3 个小时。

  •  
  •   86322989 · Oct 18, 2017 · 1810 views
    This topic created in 3112 days ago, the information mentioned may be changed or developed.

    原始需求是:如果选中的值不合适,那么使用旧值。 哈哈 ,就这么简单,我真的昨晚从 11 点弄到 12 点+今天从 1 点弄到现在。

    网上竟然找不到。

    现在贴代码,给未来的自己:

    $("#statxxxxelect").change(function(){
                var newValue = $(this).val();
                var oldValue = '<c:out value="${xxx}"/>';
                var notAllowByOthers="FINISeHED;ADMfeINFINISHED;REFUeeNDED;CANeeCELED";
                var isSueperAdmin = '<c:out value="${isSuepereAedmin}"/>';
                if(isSueperAdmin=="true"){
                }else{
                    if(notAllowByOthers.indexOf(newValue.toUpperCase())>-1){
                        alert("有权限的才能做此修改");
                        $(this).val(oldValue);
                    }
                }
    
            });
    
    1 replies    2017-10-18 15:17:11 +08:00
    86322989
        1
    86322989  
    OP
       Oct 18, 2017
    另外,有人能告诉我这个区别吗:
    <c:out value="${xxx}"/>

    ${xxx}
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   3571 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 30ms · UTC 00:43 · PVG 08:43 · LAX 17:43 · JFK 20:43
    ♥ Do have faith in what you're doing.