Detecting two consecutive carriage returns at the end of the string
<p>Is there a way to detect if there are 2 consecutive carriage returns in a string ontained from a textarea or multiline text box?</p>

<p>Here is the scenario:
In a text area, user enters ABCD "Enter" EFGHI "Enter" JKLMNOP "Enter" "Enter". After the this I need to force click event of the button - not form.submit.</p>

<p>Here is the default.aspx page:</p>

<pre><code>&lt;%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %&gt;
&lt;%@ Register Src="~/UserControls/Search.ascx" TagName="Search" TagPrefix="ucSearch" %&gt;
&lt;html xmlns="w3.org/1999/xhtml"&gt;;
&lt;head runat="server"&gt; 
&lt;title&gt;&lt;/title&gt; &lt;/head&gt;
&lt;body&gt;
&lt;form id="form1" runat="server"&gt;
&lt;asp:scriptmanager runat="server"&gt;&lt;/asp:scriptmanager&gt;
&lt;div&gt;
&lt;ucSearch:Search id="search1" runat="server" /&gt;
&lt;/div&gt;
&lt;/form&gt;
&lt;/body&gt;
&lt;/html&gt;
</code></pre>

<p>This is the Search.ascx page:</p>

<pre><code>&lt;script language="javascript"&gt;
var inputString function doit(){inputString =  document.getElementById("search1$txtSearchText").value;
if (inputString.match(/(\n\n|\r\r|\r\n\r\n)$/)) {
    document.getElementById("search1_btnFindAssets").click();
}

&lt;/script&gt;

&lt;%@ Control Language="C#" AutoEventWireup="true" CodeFile="Search.ascx.cs" Inherits="UserControls_Search"%&gt; 
&lt;asp:TextBox ID="txtSearchText" TextMode="MultiLine"onKeyPress="doit();" runat="server"&gt;
&lt;/asp:TextBox&gt;
&lt;br&gt;
&lt;asp:ButtonID="btnFindAssets"runat="server"Text="Find"onclick="btnFindAssets_Click"&gt;
</code></pre>
