Rattlesnake Posted July 22, 2005 Posted July 22, 2005 Hi, I have an ASP.net form , which is a master detail form. The master section of the form has many textboxes and a Save button. The detail part is in a Datagrid, that is editable. There is an Edit button in each row , that the use clicks to edit the row. When the row is in edit mode , the row has an Update button. What I want is that if the user hits the ENTER key while editing a row , it should execute the code that is defined at the click event of the Update button in the row. Right now what it does is it submits the form when the user presses the ENTER key. How can I stop it from doing this , and execute the Update button code. Note: When the user presses the enter key while in the master section of the form , I dont want the form to be submitted. Thanks Quote When you gotta go,you gotta go !!!!!!!
mark007 Posted July 27, 2005 Posted July 27, 2005 Take a look at this. Should give you soem ideas as to how to implement it: http://aspnet.4guysfromrolla.com/articles/090402-1.2.aspx :) Quote Please check the Knowledge Base before you post. "Computers are useless. They can only give you answers." - Pablo Picasso The Code Net
handlewithbeer Posted December 7, 2005 Posted December 7, 2005 try this? <body MS_POSITIONING="FlowLayout" onkeydown="if(event.keyCode == 13){return false;}"> it sez, if the user hits enter on the page, then do nothing. good: keeps people from submitting by mistake bad: cannot do carriage return in a multiline textbox, nor use the enter key for button click events cheers! Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.