Author: Nitin S | Posted on: 12/22/2008 7:43:22 AM | Views : 280

Hi All,

 

I have three panels inside my webform and i have 3 buttons inside each panel along with several textboxes. I want that specific button to be clicked if i press enter while my focus is on any of the textbox.

 

I achieved this by setting the DefaultButton attribute in Panel, but this resulted in disabling of a feature which was working earlier. I have specific function called onkeypress event of every textbox. And based on the keypress i restrict several type of entries, such as a textbox can only accept numeric values.

 

This was working fine before i set the DefaultButton attribute in Panel.Now the function is being called, but it is not able to cancel the keypress. Earlier if some invalid valid key was pressed i was using "return false" and textbox did not get tht value. Now even though my function is returning false, textbox is taking the key pressed.

 

I again reverte ...

Go to the complete details ...