From: Eric on 8 Jun 2010 10:10 Hi, I have a multiview view with a panel on it and in that panel a table with several controls (2 dropdown,3 textbox, 2 button, 1 gridview). When data is entered in one textbox and button1 is pressed, it puts the data in a gridview. Since the data in the textbox is a number I want it to respond to the Enter key. Hitting the enter key should do the same as the button. I have tried it by putting the panels defaultbutton on that button but while the page does a refresh, it does not go to the button click event. I have given the textbox an argument for the onkeydown event, but it also doesn't do it. ( txtVerplaatsenArtikelNummer.Attributes.Add("onkeydown", "if(event.which || event.keyCode){if ((event.which == 13) || (event.keyCode == 13)) {document.getElementById('" + btVerplaatsenNaarLijst.UniqueID + "').click();return false;}} else {return true}; ") ) How can I solve this? I cannot use the textchanged event because I need to clear the textbox after the data has been put in the table. please help me. rg, Eric
From: Eric on 8 Jun 2010 13:39 "Eric" wrote: > Hi, > > I have a multiview view with a panel on it and in that panel a table with > several controls (2 dropdown,3 textbox, 2 button, 1 gridview). > > When data is entered in one textbox and button1 is pressed, it puts the data > in a gridview. > Since the data in the textbox is a number I want it to respond to the Enter > key. > Hitting the enter key should do the same as the button. > > I have tried it by putting the panels defaultbutton on that button but while > the page does a refresh, it does not go to the button click event. > > I have given the textbox an argument for the onkeydown event, but it also > doesn't do it. ( > txtVerplaatsenArtikelNummer.Attributes.Add("onkeydown", "if(event.which || > event.keyCode){if ((event.which == 13) || (event.keyCode == 13)) > {document.getElementById('" + btVerplaatsenNaarLijst.UniqueID + > "').click();return false;}} else {return true}; ") > ) > > > How can I solve this? > I cannot use the textchanged event because I need to clear the textbox after > the data has been put in the table. > > please help me. > > rg, > Eric > I just found out that when I put the defaultbutton of the panel on the button I want to be clicked, it does not work if the cursor is in the textbox, but if I click somewhere in the panel then it does work. Why is it not working on the textbox? rg, Eric
From: James Irvine on 10 Jun 2010 03:10 "Eric" <Eric(a)discussions.microsoft.com> wrote in message news:9FFDA621-1511-43D5-8B33-DC207DA3AF85(a)microsoft.com... > "Eric" wrote: > >> Hi, >> >> I have a multiview view with a panel on it and in that panel a table with >> several controls (2 dropdown,3 textbox, 2 button, 1 gridview). >> >> When data is entered in one textbox and button1 is pressed, it puts the >> data >> in a gridview. >> Since the data in the textbox is a number I want it to respond to the >> Enter >> key. >> Hitting the enter key should do the same as the button. >> >> I have tried it by putting the panels defaultbutton on that button but >> while >> the page does a refresh, it does not go to the button click event. >> >> I have given the textbox an argument for the onkeydown event, but it also >> doesn't do it. ( >> txtVerplaatsenArtikelNummer.Attributes.Add("onkeydown", "if(event.which >> || >> event.keyCode){if ((event.which == 13) || (event.keyCode == 13)) >> {document.getElementById('" + btVerplaatsenNaarLijst.UniqueID + >> "').click();return false;}} else {return true}; ") >> ) >> >> >> How can I solve this? >> I cannot use the textchanged event because I need to clear the textbox >> after >> the data has been put in the table. >> >> please help me. >> >> rg, >> Eric >> > > > I just found out that when I put the defaultbutton of the panel on the > button I want to be clicked, it does not work if the cursor is in the > textbox, but if I click somewhere in the panel then it does work. > > Why is it not working on the textbox? > > rg, > Eric > Maybe this will work for you: <asp:panel ID="Panel1" defaultbutton="ButtonSearchx" runat="server"> <span style="float:left; clear:both; padding-left:3em;" > <asp:TextBox ID="TextBoxSearchString" Width="32em" runat="server" TabIndex="0"></asp:TextBox> <asp:Button ID="ButtonSearchx" runat="server" Font-Size=".7em" TabIndex="1" Font-Names="Comic Sans MS;Purisa" OnClick="ButtonSearchx_Click" Text="Search" /> <asp:CheckBox ID="CheckBox1" Font-Size="small" Text="exact match" runat="server" /> </span> </asp:panel> Here's where it's used: http://foodinfo.us/Default.aspx
|
Pages: 1 Prev: Best way to merge a blog engine into my website Next: From Desktop to Web base application |