Reputation: 136
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> <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?
Upvotes: 0
Views: 183
Reputation: 1888
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[]
Upvotes: 1