Read from values from hidden field values in Jquery?
- by James123
Last two nights I am struggle with below code. The problem is I need to remember expanded (or) collapsed toggles sections and on page reload I have show them as is expanded (or) collapsed.
$(function() {
$('tr.subCategory')
.css("cursor", "pointer")
.attr("title", "Click to expand/collapse")
.click(function() {
$(this).siblings('.RegText').toggle();
});
$('tr[@class^=RegText]').hide().children('td');
})
I found small solution in another forum like this. Storing ".subCategory" id values in hidden field in commas-seperated values.
In Asp.net page:
<input id="myVisibleRows" type="hidden" value="<% response.write(myVisibleRowsSavedValue) %" />
In .js:
var idsStr = $(#myVisibleRows).val();
Now My question is: How to store multiple values (.subCategory id) in hidden field when I click on toggle?. also How to parse them back and iterate them get ids and show toggles?. I am very very new to jQuery. Please some one help me out from this.