|
-
Jan 11th, 2010, 02:32 AM
#1
Thread Starter
New Member
[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.
-
Jan 11th, 2010, 03:08 AM
#2
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
-
Jan 11th, 2010, 03:19 AM
#3
Thread Starter
New Member
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>
-
Jan 11th, 2010, 03:40 AM
#4
Re: Set fous on ModalPopup
-
Jan 11th, 2010, 03:46 AM
#5
Thread Starter
New Member
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.
-
Jan 11th, 2010, 04:55 AM
#6
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
-
Jan 11th, 2010, 05:25 AM
#7
Thread Starter
New Member
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
-
Jan 13th, 2010, 06:40 AM
#8
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|