views:

28

answers:

1

Hi, I have a reeeaaally weird & strange problem with some form elements on a .ASPX page im working on.. the page form has a hidden slide-in on click of a div, section allowing the user to 'make a reservation'.

The jQuery used to animate the slide works fine, and happens on click on the ticky check-box (id="rescheck").

The problem is, instead of all the fields contained within the hidden div displaying on click of the checkbox, and thus sliding into view along with their labels, only one text field input shows, and nothing else. Checking the source code shows that these missing labels & fields are not even in the source code, dispite being in the page code when viewed (and edited) within MS Visual Studio 2008.

As you can see, the fields and their labels seem to just disappear in the browser! I have NO idea whats causing this, and am not sure where to go with it next.

This is my PAGE code, from Visual Studio:

<fieldset id="resreq">
<legend>Make a Reservation?</legend>
    <label for="rescheck" class="rescheck">If you would like to reserve a table     at Madrasi check here:</label>
    <input id="rescheck" type="checkbox" class="rescheck" runat="server" />            

    <div id="reservationfields">
        <div id="res_when">
        <div>
            <asp:Label ID="lblDate" runat="server" AssociatedControlID="txtDate">On which date would you like us to reserve your table?</asp:Label>
               <asp:TextBox ID="txtDate" runat="server" CssClass="res_date" />                   
            </div>
            <div>
                <asp:Label ID="lblTime" runat="server">and for what time?</asp:Label>
                <asp:TextBox ID="txtTime" runat="server" CssClass="res_time" />                  
         </div>                    
        </div><!-- close res_when -->
        <div> 
            <asp:Label ID="lblBranch" runat="server">At which restaurant would you like to make your reservation?</asp:Label>
            <asp:DropDownList ID="ddlBranch" runat="server">
                <asp:ListItem Text="Select a Restaurant" Value="" />
                <asp:ListItem Text="Restaurant 1" Value="Restaurant 1" />
                <asp:ListItem Text="Restaurant 2" Value="Restaurant 2" />
            </asp:DropDownList>
        </div>
        <div>
            <asp:Label ID="lblPeople" runat="server" AssociatedControlID="txtPeople" Text="Number of Guests:" />
            <asp:TextBox ID="txtPeople" runat="server" />  
        </div>
        <div>
            <asp:Label ID="lblDOB" runat="server" AssociatedControlID="txtDOB">Date of Birth:</asp:Label>
            <asp:TextBox ID="txtDOB" runat="server" />                   
        </div>
    </div><!-- close reservation fields -->
</fieldset>

...and this is the Source Code when you 'view source' in the browser:

    <fieldset id="resreq">

    <legend>Make a Reservation?</legend>

        <label for="rescheck" class="rescheck">If you would like to reserve a table at Madrasi check here:</label>

        <input name="ctl00$cpcMain$rescheck" type="checkbox" id="ctl00_cpcMain_rescheck" class="rescheck" />        

        <div id="reservationfields">

         <div id="res_when">

          <div>



                 <input name="ctl00$cpcMain$txtDate" type="text" id="ctl00_cpcMain_txtDate" class="res_date" />                   

             </div>

             <div>





 </div>                    

          </div>

            <div> 





            </div>

            <div>





            </div>

            <div>





                <span id="ctl00_cpcMain_rvDOB" style="color:Red;visibility:hidden;">You have entered your Date of Birth incorrectly (dd/mm/yyyy).</span>

            </div>
            </div><!-- close reservation fields -->
    </fieldset>
A: 

Is there anything in the codebehind that sets the Visible property of any of the controls to false ? That causes the controls not to be rendered in the HTML at all instead of putting them in invisible state, which can be quite confusing because many wouldn't expect that.

GCATNM
I have this @ the end of the document: (I have also tried removing this script snippet below, but it makes no difference)
Phil
<script type="text/javascript"> function showme(it, box) { var vis = (box.checked) ? "block" : "none"; document.getElementById(it).style.display = vis; }</script>
Phil
bump?..........
Phil