Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > simple problem with multiline textboxes in ASP.NET.....

Reply
Thread Tools

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

 
 
Antonio Lopez Arredondo
Guest
Posts: n/a
 
      11-26-2004
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


 
Reply With Quote
 
 
 
 
Jason MacKenzie
Guest
Posts: n/a
 
      11-26-2004
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.



"Antonio Lopez Arredondo" <(E-Mail Removed)> wrote in message
news:e3phZz%(E-Mail Removed)...
> 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
>
>



 
Reply With Quote
 
 
 
 
Bob Lehmann
Guest
Posts: n/a
 
      11-26-2004
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

"Antonio Lopez Arredondo" <(E-Mail Removed)> wrote in message
news:e3phZz%(E-Mail Removed)...
> 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
>
>



 
Reply With Quote
 
Jason MacKenzie
Guest
Posts: n/a
 
      11-26-2004
This was a while ago and I'm not sure of the specific set of circumstances
was. It was happening to me.


"Bob Lehmann" <(E-Mail Removed)> wrote in message
news:edBOvY$(E-Mail Removed)...
> 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
>
> "Antonio Lopez Arredondo" <(E-Mail Removed)> wrote in message
> news:e3phZz%(E-Mail Removed)...
>> 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
>>
>>

>
>



 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Why doesn't MaxLength work with multiline TextBoxes? danthman ASP .Net 11 05-11-2010 10:00 AM
Get data, make textBoxes, edit values, and re-save to database. Simple? \A_Michigan_User\ ASP .Net 5 02-13-2006 04:32 PM
Simple Calculation in Form - 3 textboxes - 1 function rdavis7408@gmail.com Javascript 9 01-25-2006 07:34 PM
how to define a variable to hold a multiline text input in perl from html multiline textbox dale zhang Perl Misc 8 11-30-2004 06:53 AM
Javascript into ASP.Net Simple example wanted.. Sum Textboxes client side Davisro ASP .Net 4 04-10-2004 08:42 AM



Advertisments