简体   繁体   中英

Passing Input Data Between HTML Text Boxes

I am using an external HTML resource within a C# project on VS. In order to populate web pages I am passing in areas of the resource into the c# code. However, I wish to pass in user typed inputs to other inputs. An example area is shown below:

!!!ThisIsSearchArea###
        <br>Customer Number <input type="text" name="customerNumber" id="customerNumber"><br>
        <br>Account Number  <input type="text" name="accountNumber" id="accountNumber"><br>

        <input name ="hiddenName" type="hidden" value="1" />
        <br>&nbsp<br><hr>

       <div>                  
    <a href="#" id="IntegrationSearchLink" data-action="IntegrationComponent_BC0625B6-7690-4CEA-8C42-B2C433FD5315">Search</a>
     <script type="text/javascript">
         $(document).ready(
        function () {
            $('#IntegrationContinueLink').hide();
            $('#IntegrationSearchLink').button();
            $('#IntegrationSearchLink').click(function (event) {
                $('#hidIntegrationCommand').val('SearchCustomers');
                ExecuteAction(event, $(this));
            });

        });

Now this search area is present on all my webpages and when the javascript runs a new webpage is brought up. However, when this area is used again I lose the input values of the two text inputs and they are blank. Therefore is there a way of retaining these values using javascript or some other code?

Use cookies, other than that, as with any client side scripting, you can't possibly do that.

If you're using any server side language like php, you can store that value in your session variable.

$_SESSION[]

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