input name and id changes when set runat=server

前端 未结 6 1737
终归单人心
终归单人心 2020-12-01 17:51

In my form I need to insert different inputs of type \"text\". The inputs must be html controls with name and id\'s. Because I send this form to a external url.

For

6条回答
  •  野趣味
    野趣味 (楼主)
    2020-12-01 18:34

    ClientIDMode only affects IDs. if you also need to manage name attribute then it's useless. In my case I solved this on the client side with jQuery.

    $(function(){
    
        $("#inputname").prop("name",$("#inputname").prop("id"));
    
    });
    

提交回复
热议问题