Firefox submits form when pressing enter in text area

Posted on 2007-10-01
Last Modified: 2012-06-21
I have a text box here in ASP page,

but when I press enter to have more extra lines, the form would actually submit. This only happens in Firefox. It's fine on IE.

Does anyone know how to fix that?

<asp:TextBox ID="txbMessage" runat="server" MaxLength="2000" width="240px" Rows="10" TextMode="MultiLine" />
Question by:jtcy
    LVL 25

    Expert Comment

    use a textarea instead

    Author Comment

    It's, we can only use textbox
    LVL 25

    Accepted Solution

    LVL 25

    Expert Comment

    by:Lee Savidge

    This is because ASP.NET pages have the submit button as the default action for the page. There is a way to override it. I have some code somewhere. I'll get back to you.


    LVL 75

    Assisted Solution

    by:Michel Plungjan
    LVL 1

    Expert Comment

    Forced accept.

    EE Admin

    Featured Post

    Highfive + Dolby Voice = No More Audio Complaints!

    Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

    Join & Write a Comment

    This is a PowerShell web interface I use to manage some task as a network administrator. Clicking an action button on the left frame will display a form in the middle frame to input some data in textboxes, process this data in PowerShell and display…
    International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
    In this tutorial viewers will learn how to embed videos in a webpage using HTML5. Ensure your DOCTYPE declaration is set to HTML5: "<!DOCTYPE html>": Use the <video> tag to insert a video. Define the src as the URL of your video; this is similar to …
    The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)

    731 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    18 Experts available now in Live!

    Get 1:1 Help Now