简体   繁体   English

如何在C#中将多个文本框值存储到一个应用程序变量中

[英]How to store multiple textbox values into one application variable in c#

[code page="c#"] Hdnano.Value = Application["AccountNum"].ToString();

 $(document).ready(function() { $("#ano").on("blur", function() { var accountNum = $('textarea#ano').val(); $("#Hdnano").val(folioNum); }); 

 <html> <body> <form> <div class="container"> <div class="row"> <div class="col-xs-3 col-lg-2"> SELECT bank name </div> <div class="col-xs-3 col-lg-3"> <input id="Text1" type="text" class="form-control" /> </div> </div> <div class="row"> <div class="col-xs-3 col-lg-2"> father name </div> <div class="col-xs-3 col-lg-3"> <input id="Text1" type="text" class="form-control" /> </div> <div class="col-xs-3 col-lg-2"> father mobile no </div> <div class="col-xs-3 col-lg-3"> <input id="Text1" type="text" class="form-control" /> </div> </div> <div class="row"> <div class="col-xs-3 col-lg-2"> mother name </div> <div class="col-xs-3 col-lg-3"> <input id="Text1" type="text" class="form-control" /> </div> <div class="col-xs-3 col-lg-2"> mother mobile no </div> <div class="col-xs-3 col-lg-3"> <input id="Text1" type="text" class="form-control" /> </div> </div> <div class="row"> <div class="col-xs-3 col-lg-2"> Account numbers </div> <div class="col-xs-3 col-md-6 col-lg-6"> <textarea class="form-control" rows="5" id="fno"></textarea> </div> </div> </div> </form> </body> </html> 

How to store multiple textbox values into one application variable ? 如何将多个文本框值存储到一个应用程序变量中? here Customer details which are select bank name ,father/mother name and mobile number into one application variable ,and the multiple account numbers which is in text area into second application variable ?I want to store values of customer into application variable and than want to pass this values onto other page which is also similar kind of this html page.How can I use here json string 在这里,客户详细信息包括选择银行名称,父亲/母亲姓名和手机号码到一个应用程序变量中,以及文本区域中的多个帐号到第二个应用程序变量中?我想将客户的值存储到应用程序变量中,而不是想要将此值传递到其他与此HTML页面也类似的页面上。如何在此使用json字符串

You can name variables like array elements. 您可以命名变量,例如数组元素。 Look at this: 看这个:

<form action="" method="POST">
    <input type="text" name="name1[first]">
    <input type="text" name="name1[second]">
    <input type="text" name="name1[third]">

    <input type="text" name="name2[0]">
    <input type="text" name="name2[1]">
    <input type="submit">
</form>

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM