Is it valid to have two input elements with the same name?

前端 未结 6 1128
爱一瞬间的悲伤
爱一瞬间的悲伤 2020-12-13 11:40

i.e.:

and

6条回答
  •  执笔经年
    2020-12-13 12:15

    A) Your first example is okay, because the forms time of submission will be different:

    
          
    
    

    B) Your second example is also okay, but not standard coding practice:

    Java code two extract both values:

    Map parmMap = requestObj.getParameterMap();   
    String input1 = parmMap.get("url")[0];   
    String input2 = parmMap.get("url")[1];
    

提交回复
热议问题