simple problem with multiline textboxes in ASP.NET.....

  • Thread starter Thread starter Antonio Lopez Arredondo
  • Start date Start date
A

Antonio Lopez Arredondo

hi all again.....

I have an ASP.NET application that has a multiline textbox and a single
button.

the user should be able to write inside the many paragraphs in the multiline
textbox and then click the button to run the code behind.

the problem is that when the user presses the ENTER key to insert a new line
in the listbox, the button's code behind is executed.

is there any way to prevent this to happen ? I just want nothing to happen
when the ENTER key is pressed inside a multiline textbox.

thanks in advance,
ant
 
I resolved this problem using client side code.

In the onfocus event of the text box I called a method that sets a page
level javascript variable to true and the blur event sets it to false.

If window.event.keycode = 13 (enter key) I check for the value of that
variable before I decide what to do.

There may be an easier approach but this works great.
 
Do you have a sample of this behavior?

My experience, when pressing the Enter Key, has been a new line in the
textarea - as expected.

Bob Lehmann
 
This was a while ago and I'm not sure of the specific set of circumstances
was. It was happening to me.
 
Back
Top