简体   繁体   中英

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

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>

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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