javascript - ASP.NET CheckBox inside a hidden DIV always returns false -


i have set of form elements within hidden div follows:

<div id="jdivupdatefolder" style="display:none;">     <asp:textbox id="txteditfoldername" runat="server"></asp:textbox><br />     <asp:textbox id="txteditfolderdesc" runat="server" textmode="multiline"></asp:textbox><br />     <asp:fileupload id="fueditphoto" runat="server" /><br />     <asp:dropdownlist id="ddleditcontentorder" runat="server">         <asp:listitem value="0" text="ascending"></asp:listitem>         <asp:listitem value="1" text="descending"></asp:listitem>     </asp:dropdownlist><br />     <asp:checkbox id="chkeditisactive" runat="server" text="active" /><br />     <asp:checkbox id="chkeditshowonhome" runat="server" text="show on homepage" /><br />     <asp:linkbutton cssclass="anchorbutton green" id="btnsaveeditfolder" text="save" runat="server"></asp:linkbutton> 

i toggle visibility of div via function in jquery (not including here simplicity purposes)

when form submitted click event of btnsaveeditfolder, can retreive values of textboxes, fileupload control , dropdownlist correctly. somehow, checkboxes return false. going nuts on this..

protected sub btnsaveeditfolder_click(sender object, e system.eventargs) handles btnsaveeditfolder.click     dim fid integer = convert.toint32(txtfolderid.value.trim) ' value     dim fname string = txteditfoldername.text.trim ' value     dim fdesc string = txteditfolderdesc.text.trim ' value     dim order string = iif(ddleditcontentorder.selecteditem.value = "0", "asc", "desc") ' value     dim isactive boolean = iif(chkeditisactive.checked, true, false) ' ## false     dim isvisible boolean = iif(chkeditshowonhome.checked, true, false) ' ## false end sub 

when remove style display:block; , form visible on page start with, return correct values (true if checked, false if not..)

anyone came accross such problem?

set checkbox's value true:

value="true" 

post , let me know if works. sounds silly , holler if trick if not i'll further you.


Comments

Popular posts from this blog

SPSS keyboard combination alters encoding -

Add new record to the table by click on the button in Microsoft Access -

CSS3 Transition to highlight new elements created in JQuery -