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

Discussion in 'ASP .Net' started by Antonio Lopez Arredondo, Nov 26, 2004.

  1. 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
    Antonio Lopez Arredondo, Nov 26, 2004
    #1
    1. Advertising

  2. 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" <> wrote in message
    news:e3phZz%...
    > 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
    >
    >
    Jason MacKenzie, Nov 26, 2004
    #2
    1. Advertising

  3. Antonio Lopez Arredondo

    Bob Lehmann Guest

    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" <> wrote in message
    news:e3phZz%...
    > 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
    >
    >
    Bob Lehmann, Nov 26, 2004
    #3
  4. This was a while ago and I'm not sure of the specific set of circumstances
    was. It was happening to me.


    "Bob Lehmann" <> wrote in message
    news:edBOvY$...
    > 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" <> wrote in message
    > news:e3phZz%...
    >> 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
    >>
    >>

    >
    >
    Jason MacKenzie, Nov 26, 2004
    #4
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Davisro
    Replies:
    4
    Views:
    789
    Bruno Sirianni
    Apr 10, 2004
  2. Lloyd Sheen
    Replies:
    3
    Views:
    353
    Mythran
    Jun 29, 2004
  3. danthman
    Replies:
    11
    Views:
    10,131
    elizas
    May 11, 2010
  4. \A_Michigan_User\
    Replies:
    5
    Views:
    481
  5. dale zhang
    Replies:
    8
    Views:
    419
    Tintin
    Nov 30, 2004
Loading...

Share This Page