I don't have anything handy to test this with but I believe you could
handle this with the onHide callback. Check that the text element
isn't empty. If it is, return false to keep the dialog open (and
display a msg, etc.)

On Sun, Dec 20, 2009 at 10:38 PM, Dexter <varun.dex...@gmail.com> wrote:
>  0  vote down  star
>
>
> Hi, I have a jmodal popup which asks for name. One textbox and one
> button.
>
> Name is required hence it has required field validator on it. And the
> button and the textbox belong to same validation group. I click "save"
> button, which saves the name and closes the popup. The problem is that
> when the name is not entered, the popup closes, therefore the popup
> should not close but since i have jqm.Hide() on button's OnClientClick
> it closes.
>
> So what I did is I removed the jqm.Hide(), add a css class to button
> "CloseJQMModal' and I try to close the popup myself from server when
> the save button is clicked.
>
> The code for that is:
>
>    Sys.WebForms.PageRequestManager.getInstance().add_endRequest
> (CloseEndRequest);
>
>    function CloseEndRequest(sender, args) {
>        if ($(sender._postBackSettings.sourceElement).hasClass
> ('CloseJQMModal'))
>
>    { $('.jqmOverlay').each(function() { $(this).remove(); }); } }
>
> This works, the popup closes and validators work. The only problem is,
> that after this i am unable to focus on any of the textboxes on the
> page. The cursor doesnt come in textboxes at all. I can still
> manipulate with dropdowns and buttons though but not textboxes!
> Although I can just right click and paste in any textboxes but i just
> cant type it myself or focus on textboxes.
>
> I have no idea why this is happening.
>
> Any ideas or suggestions will be really helpful.
>
> Thanks
>

Reply via email to