I've tried several different methods, but the dialog does not
disappear.  The <div> that's the dialog is "fscbox".  When I
call .hide or dialog("close") or dialog("destroy") it still appears.
When I do a hide, it will disappear, but the text that was behind it
does not reappear properly and it's just a blank box in the middle of
the page.  Here's the full code from an aspx page:

[code]

<asp:Content ID="HeadContent" ContentPlaceHolderID="head"
runat="server">
    <style type="text/css"> @import url("Content/fscpop.css");</
style>
    <script type="text/javascript" src="<%= ResolveClientUrl("~/
Content/Scripts/jquery-1.2.6.js")%>"></script>
    <script type="text/javascript" src="<%= ResolveClientUrl("~/
Content/Scripts/common.js")%>"></script>
    <script type="text/javascript" src="<%= ResolveClientUrl("~/
Content/Scripts/ui-base.js")%>"></script>
    <script type="text/javascript" src="<%= ResolveClientUrl("~/
Content/Scripts/ui-dialog.js")%>"></script>

<script type="text/javascript">
history.forward();

var logoffurl   = '<%= Url.Action("logoff", "greeting") %>';

/*
    When doc is loaded, attach a function to the FSC
    popup (found by getting the only link that will have
    href="javascript") and create a dialog that will
    appear just below the link when clicked
*/
$(document).ready(function() {
    checkPopupMessages();

    //var popup = $('#productIframe').contents().find('a
[href^=javascript:showFscPopup]');

    $("a[href^=javascript:showFscPopup]").click(function() {
        var link = $(this), offset = link.offset();
        $("#fscbox").dialog({
            position: [offset.left, offset.top + link.height()]
        });
    });

    $("a[href^=javascript:showAdminPopup]").click(function() {
        var link = $(this), offset = link.offset();
        $("#adminbox").dialog({
            position: [offset.left, offset.top + link.height()]
        });
    });

    $("#fscbox").hide();
    $("#adminbox").hide();

    // auto-tab and force numerics in FSC date field data entry
    $('#evt_mm').autotab({ target: '#evt_dd', format: 'numeric' });
    $('#evt_dd').autotab({ target: '#evt_yy', format: 'numeric',
previous: '#evt_mm' });
    $('#evt_yy').autotab({ previous: '#evt_dd', format: 'numeric' });

});

function showFscPopup() {
    $("fscbox").css("popup");
    $("#fscbox").show();
    $("#errorMessages").html("");
    $("#fscbox").dialog("open");
}

function showAdminPopup() {
    $("#adminbox").css("popup");
    $("#adminbox").show();
    $("#errorMessages").html("");
    $("#adminbox").dialog("open");
}

function closePopup() {
    $("#errorMessages").html("");
    $("form input").val("");
    $("#fscbox").hide();
    $("#fscbox").dialog("close");
}

function closeAdminPopup() {
    $("#errorMessages").html("");
    $("form input").val("");
    $("#adminbox").hide();
    $("#adminbox").dialog("close");
}


function loadBody(webpage) {
        if (webpage.length > 0)
                window.open
(webpage,"external","resizable=yes,toolbar=no,directories=no,status=no,menubar=0,scrollbars=yes,width=600,height=500");
}

/*
    Do Ajax post of reset PIN
*/
function resetPin() {
    $.post('<%= Url.Action("resetpin", "security") %>',
        null,
        function(message) {
            alert(message);
        }
    );
}

/*
    Do Ajax post of event criteria and receive back
    any error message that occurred.
*/
function empEvent() {
    $("#errorMessages").html("");
    if(validateDate()) {
        $.post('<%= Url.Action("createevent", "event") %>',
            {
                fscEvent: $("#fscEvent").val(),
                evt_mm: $("#evt_mm").val(),
                evt_dd: $("#evt_dd").val(),
                evt_yy: $("#evt_yy").val(),
                fscDate: getEventDate()
            },
            function(message) {
                processEventCreationResponse(message);
            }
        );
    }
}

/*
    Do Ajax post of event criteria and receive back
    any error message that occurred.
*/
function adminEvent() {
    $("#adminErrorMessages").html("");
    if(validateAdminDate()) {
        $.post('<%= Url.Action("createevent", "event") %>',
            {
                fscEvent: $("#adminEvent").val(),
                evt_mm: $("#adm_evt_mm").val(),
                evt_dd: $("#adm_evt_dd").val(),
                evt_yy: $("#adm_evt_yy").val(),
                fscDate: getEventAdminDate()
            },
            function(message) {
                processAdminEventCreationResponse(message);
            }
        );
    }
}

function subimo() {
    var msg = '<%= Html.Resource("greeting.menu.subimowarning")%>';
    if (confirm(msg)) {
        window.open('<%= Url.Action("subimo", "event") %>', "_new");
    }
}

/*
    If an error has occurred, alert user so they
    can fix error.  Otherwise, submit
*/
function processEventCreationResponse(message) {
    if(message!=null && message!="") {
        $("#errorMessages").html(message);
    }
    else {
        document.forms[0].submit();
    }
}

/*
    If an error has occurred, alert user so they
    can fix error.  Otherwise, submit
*/
function processAdminEventCreationResponse(message) {
    if(message!=null && message!="") {
        $("#adminErrorMessages").html(message);
    }
    else {
        document.forms[1].submit();
    }
}

function validateDate() {
    if ($("#evt_mm").val().match(/(0[1-9]|1[012])/) &&
        $("#evt_dd").val().match(/(0[1-9]|[12][0-9]|3[01])/) &&
        $("#evt_yy").val().match(/(19|20)\d\d/)) {
        return true;
    }
    else {
        $("#errorMessages").html('<%= Html.Resource
("greeting.menu.entervaliddate")%>');
        return false;
    }
}

function getEventDate() {
    if (validateDate()) {
        return $("#evt_mm").val() + '/' + $("#evt_dd").val() + '/' + $
("#evt_yy").val();
    }
    else {
        return '';
    }
}

function validateAdminDate() {
    if ($("#adm_evt_mm").val().match(/(0[1-9]|1[012])/) &&
        $("#adm_evt_dd").val().match(/(0[1-9]|[12][0-9]|3[01])/) &&
        $("#adm_evt_yy").val().match(/(19|20)\d\d/)) {
        return true;
    }
    else {
        $("#adminErrorMessages").html('<%= Html.Resource
("greeting.menu.entervaliddate")%>');
        return false;
    }
}

function getEventAdminDate() {
    if (validateAdminDate()) {
        return $("#adm_evt_mm").val() + '/' + $("#adm_evt_dd").val() +
'/' + $("#adm_evt_yy").val();
    }
    else {
        return '';
    }
}

function logoff() {
    window.location.href = logoffurl;
}


</script>

</asp:Content>

<asp:Content ID="MainContent" ContentPlaceHolderID="main"
runat="server">
    <script type="text/javascript" src="<%= ResolveClientUrl("~/
Content/Scripts/ui-base.js")%>"></script>
    <script type="text/javascript" src="<%= ResolveClientUrl("~/
Content/Scripts/ui-dialog.js")%>"></script>

    <b><% =ViewData.Model.FullName %></b>

    <p class="benarea"><%= Html.Resource("greeting.header.mainmenu")
%></p>
    <asp:Panel ID="PanelWarningText" Visible="false" runat="server">
        <p>
            <%= Html.Resource("greeting.menu.threedaywarning")%>
        </p>
    </asp:Panel>
    <asp:ListView ID="MainMenu" runat="server"
        ItemPlaceholderID="itemsGoHere"
        GroupPlaceholderID="groupsGoHere">

       <LayoutTemplate>
            <div class="mainMenu">
                <asp:PlaceHolder runat="server" ID="groupsGoHere"></
asp:PlaceHolder>
            </div>
       </LayoutTemplate>

       <GroupTemplate>
            <div class="mainMenuColumn">
              <table width="100%" border="0" cellpadding="0">
                 <asp:PlaceHolder runat="server" ID="itemsGoHere"></
asp:PlaceHolder>
              </table>
            </div>
       </GroupTemplate>

       <ItemTemplate>
          <tr>
                <td valign="bottom">
                    <%#WriteButton(Eval("Link")) %>
            </td>
                <td align='left'><br clear='right'>
                <%#WriteLink(Eval("Link"), Eval("Target"), Eval
("Title"))%>
                </td>
              </tr>
          <tr>
                <td></td>
                <td class='spmaincopy'>
                        <%#WriteDescription(Eval("Link"), Eval("Description"))
%><br>
                </td>
          </tr>
       </ItemTemplate>
    </asp:ListView>


    <div id="fscbox" class="hideme" >
    <form name="greetingsform" action="<%= Url.Action("redirectevent",
"event") %>" method="post">
        <table border='0' >
            <tr>
                <td class='popuptxt'>
                    <ResMgr:XmlRes ID="fscbox_date"
Key="greeting.fscbox.date" runat="server" />
                </td>
            </tr>
            <tr id="dateInput">
                <td class='popuptxt'>
                    <input name="evt_mm" id="evt_mm" size="2"
maxlength="2" />
                    <input name="evt_dd" id="evt_dd" size="2"
maxlength="2" />
                    <input name="evt_yy" id="evt_yy" size="4"
maxlength="4" />
                </td>
            </tr>
            <tr><td id="errorMessages" style="color:Red"></td></tr>
            <tr>
                <td class='popuptxt'>
                    <ResMgr:XmlRes ID="fscbox_reason"
Key="greeting.fscbox.reason" runat="server" />
                </td>
            </tr>
            <tr>
                <td >
                        <select name="fscEvent" id="fscEvent">
                            <%=WriteOptions() %>
                    </select>
                </td>
            </tr>
            <tr>
                <td class="popuptxt">
                    <ResMgr:XmlRes ID="fscbox_finished"
Key="greeting.fscbox.finished" runat="server" />
                </td>
            </tr>
            <tr>
                <td align='center' class='popuptxt'>
                    <a href="javascript:empEvent();"><ResMgr:XmlRes
ID="XmlRes1" Key="greeting.fscbox.continue" runat="server" /></a>
                    <a href="javascript:closePopup();"><ResMgr:XmlRes
ID="XmlRes2" Key="greeting.fscbox.close" runat="server" /></a>
                </td>
            </tr>
        </table>

        <asp:PlaceHolder ID="HiddenPlace" runat="server">
            <%= Html.Hidden("Message", ViewData.Model.GetMessage()) %>
        </asp:PlaceHolder>

    </form>
</div>

<div id="adminbox" class="hideme" >
    <form name="adminform" action="<%= Url.Action("redirectevent",
"event") %>" method="post">
        <table border='0' >
            <tr>
                <td class='popuptxt'>
                    <ResMgr:XmlRes ID="XmlRes3"
Key="greeting.fscbox.date" runat="server" />
                </td>
            </tr>
            <tr id="Tr1">
                <td class='popuptxt'>
                    <input name="adm_evt_mm" id="adm_evt_mm" size="2"
maxlength="2" />
                    <input name="adm_evt_dd" id="adm_evt_dd" size="2"
maxlength="2" />
                    <input name="adm_evt_yy" id="adm_evt_yy" size="4"
maxlength="4" />
                </td>
            </tr>
            <tr><td id="adminErrorMessages" style="color:Red"></td></
tr>
            <tr>
                <td class='popuptxt'>
                    <ResMgr:XmlRes ID="XmlRes4"
Key="greeting.fscbox.reason" runat="server" />
                </td>
            </tr>
            <tr>
                <td >
                        <select name="adminEvent" id="adminEvent">
                            <%= WriteAdminOptions() %>
                    </select>
                </td>
            </tr>
            <tr>
                <td class="popuptxt">
                    <ResMgr:XmlRes ID="XmlRes5"
Key="greeting.fscbox.finished" runat="server" />
                </td>
            </tr>
            <tr>
                <td align='center' class='popuptxt'>
                    <a href="javascript:adminEvent();"><ResMgr:XmlRes
ID="XmlRes6" Key="greeting.fscbox.continue" runat="server" /></a>
                    <a href="javascript:closeAdminPopup
();"><ResMgr:XmlRes ID="XmlRes7" Key="greeting.fscbox.close"
runat="server" /></a>
                </td>
            </tr>
        </table>

        <asp:PlaceHolder ID="PlaceHolder1" runat="server">
            <%= Html.Hidden("Message", ViewData.Model.GetMessage()) %>
        </asp:PlaceHolder>

    </form>
</div>


</asp:Content>


[/code]
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"jQuery UI" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/jquery-ui?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to