I have some content stored in hidden field like :" 1Hello-2Hai-3Bye-4GoodBye"
First time when page is displayed , it should display : "Hello"
We have two buttons , forward N Backward buttons.
When I Click on forward button , It should show : "Hai"
When I Click on backward button , it should display: "Hello"
in my label
<script type="text/javascript">
$(document).ready(function () {
var test = $("#hdnFiled").val(); // This is my content : "1Hello-2Hai-3Bye-4GoodBye"
$('#<%= lblMessage.ClientID %>').html(test);
});
</script>
function (int i) {
var test = "1Hello-2Hai-3Bye-4GoodBye";
var stringarray=test.split("-");
for (var i = 0; i < stringarray.length; i++) {
stringarray[i] = stringarray[i].substring(1);
}
document.write(stringarray[i]);
}
gopikrsna
Member
190 Points
234 Posts
Jquery to hide / show data on based on navigation
Apr 05, 2012 07:07 AM|LINK
I have some content
I have some content stored in hidden field like :" 1Hello-2Hai-3Bye-4GoodBye"
First time when page is displayed , it should display : "Hello"
We have two buttons , forward N Backward buttons.
When I Click on forward button , It should show : "Hai"
When I Click on backward button , it should display: "Hello"
in my label
<script type="text/javascript">
$(document).ready(function () {
var test = $("#hdnFiled").val(); // This is my content : "1Hello-2Hai-3Bye-4GoodBye"
$('#<%= lblMessage.ClientID %>').html(test);
});
</script>
Dino He - MS...
Star
8068 Points
1023 Posts
Microsoft
Re: Jquery to hide / show data on based on navigation
Apr 09, 2012 08:09 AM|LINK
Hi
You can use javascript to get it :
function (int i) { var test = "1Hello-2Hai-3Bye-4GoodBye"; var stringarray=test.split("-"); for (var i = 0; i < stringarray.length; i++) { stringarray[i] = stringarray[i].substring(1); } document.write(stringarray[i]); }You will get the value by index.
If you have any feedback about my replies, please contact msdnmg@microsoft.com
Microsoft One Code Framework