i'm using htmlbutton make htmltablerows have been hidden visible. htmlbutton created , set so:
htmlbutton btnaddfoapalrow = null; . . . btnaddfoapalrow = new htmlbutton(); btnaddfoapalrow.attributes["type"] = "button"; btnaddfoapalrow.innerhtml = "+"; btnaddfoapalrow.id = "btnaddfoapalrow"; this.controls.add(btnaddfoapalrow); i create htmltablecells programmatically, add cells dynamically created htmltablerows, , add htmltablerows htmltable.
rows 3 , 4 start off life hidden under bushel (so speak):
foapalrow3.style["display"] = "none"; . . . foapalrow4.style["display"] = "none"; the above happens server-side/c#; respond btnaddfoapalrow's click in jquery make next hidden row, long there one, unhidden/visible:
/* makes next hidden row visible, long there 1 */ $(document).on("click", '[id$=btnaddfoapalrow]', function (e) { $('[id$=foapalhtmltable]').find('tr:hidden:first').show(); }); this works slicker grace. problem when submit form, htmltable reverts showing initial 2 rows (header row , 1 data row); 1 or 2 additional data rows i've added clicking btnaddfoapalrow "go invisible" again (revert "display:none" apparently). if re-click btnaddfoapalrow, rows reappear entered data still intact -- haven't been 86'd, they're being shy -- how can prevent these rows folding up/hiding @ all?
going @trueblueaussie said in comments, need have fact form has been submitted persist through page load.
you can either handle somehow on server side (db update perhaps) or make simpler create cookie javascript.
Comments
Post a Comment