Results 1 to 8 of 8

Thread: [RESOLVED] Set focus on ModalPopup and Perform Search

  1. #1

    Thread Starter
    New Member
    Join Date
    Nov 2009
    Posts
    13

    Resolved [RESOLVED] Set focus on ModalPopup and Perform Search

    Hi, I'm working on web and I don't know how to do it.

    I open the ModalPopup by button. But the focus continues in the button and y want that the focus goes to textbox inside my ModalPopup.

    How can I do?

    Thanks in advance and sorry for my bad English.
    Last edited by Krato; Jan 11th, 2010 at 05:27 AM.

  2. #2
    PowerPoster gep13's Avatar
    Join Date
    Nov 2004
    Location
    The Granite City
    Posts
    21,963

    Re: Set fous on ModalPopup

    Hey,

    I take it you mean you are using the AJAX Control Toolkit, is that right?

    Can you post the code/markup that you are currently using?

    Gary

  3. #3

    Thread Starter
    New Member
    Join Date
    Nov 2009
    Posts
    13

    Re: Set fous on ModalPopup

    There is very simply:

    Popup DIv elemenet called 'modalAg' and this:

    <asp:button id="Busca" runat="server" Width="125px" Text="Buscar"
    CausesValidation="False" TabIndex="15"></asp:button>
    <cc1:ModalPopupExtender ID="Busca e_ModalPopupExtender" runat="server"
    DynamicServicePath="" Enabled="True" TargetControlID="Busca" CancelControlID="Cancelar"
    PopupControlID="modalAg">
    </cc1:ModalPopupExtender>

  4. #4

  5. #5

    Thread Starter
    New Member
    Join Date
    Nov 2009
    Posts
    13

    Re: Set fous on ModalPopup

    Well I do it by Js.
    But, I have 3 buttons on the page, and I need that when pulse Enter don't show the popup. I want that perform the form. How can I do it?

    Thanks!
    Last edited by Krato; Jan 11th, 2010 at 04:45 AM.

  6. #6
    PowerPoster gep13's Avatar
    Join Date
    Nov 2004
    Location
    The Granite City
    Posts
    21,963

    Re: Set fous on ModalPopup

    Hey,

    I am really not sure that I follow what you are asking? Can you elaborate? Perhaps with the use of screen shots?

    Gary

  7. #7

    Thread Starter
    New Member
    Join Date
    Nov 2009
    Posts
    13

    Re: Set fous on ModalPopup

    Well I get the answer by my self again.

    I add an event for all textbox of page: onkeypress="sendform(event)" and check if its Enter Key. If its send the form

    the js for if someone need:

    function sendform(e){
    key = (document.all) ? e.keyCode : e.which;
    if (key==13) {
    $('#ctl00_ContentPlaceHolder1_Search').click();
    }
    }

    Thanks gep13 for your replys

  8. #8
    I'm about to be a PowerPoster! mendhak's Avatar
    Join Date
    Feb 2002
    Location
    Ulaan Baator GooGoo: Frog
    Posts
    38,170

    Re: [RESOLVED] Set focus on ModalPopup and Perform Search

    If you were trying to set focus to the textbox, you could send some javascript from the codebehind to the page.

    string jsToSend = "$('" + SearchTextBox.ClientID + "').focus();";

    So that you're not hardcoding the ClientID in your javascript.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width