Question: I am tried this sample :

```
public string TextFileProcess(string strReadtext, int nMinLine, int nMaxLine)
    {
        string strcount = string.Empty;
        List<string> lstResults = new List<string>();
        lstResults.Add(null);
        string strpattern= @"(?<=[\.!\?])+";
        string[] strSplitlines = Regex.Split(strReadtext, strpattern);
        string strresults=null;

        foreach(string  strsplittextsentence in strSplitlines)
        {
            string strsplittext= Regex.Replace(strsplittextsentence, @"[\s\r\n]+", " ");

            lstResults.Add((strsplittext));

            for(int i=1; i<lstResults.Count; i++)
            {
                strcount = lstResults[i] + lstResults[i - 1];
            }

            if(strsplittext.Length<=nMinLine)
            {
                    if(strcount.Length <= nMaxLine)
                    {
                        strresults += strcount;
                    }
                    else
                    {
                        if(nMinLine <= strsplittext.Length & nMaxLine >= strsplittext.Length)
                        {
                            strresults = strsplittext;
                            Console.WriteLine(strresults + Environment.NewLine);
                        }
                    }
                //lstResults.Clear();
            }

        }
        return strresults;
    }

```

I need output:
If min = 30 and max = 37 then the output is 
 "Truth is fiction. Safety is danger.“
because the two sentences are consecutive sentences with the desired length.

Answer: 
change `method` to `type` as following

```
function sendEmail(){
        $.ajax({
            url: "http://formspree.io/email1@gmail.com",
            type: "POST",
            data: $('#emailForm').serialize(),
            dataType: "json",
            success: function(result){
                $("#success").html("Message successfully sent");
            },
            error: function (request, status, error) {
                $("#success").html("Oops! Something went wrong. Please try again");
            }
        });
        return false
    }

```
`ajax` is `asynchronus` Your form submit is triggered as soon as the button is clicked and the `ajax` method runs in background. That's why it is triggering `get`.

**As `GET` is default http method. look here:** <https://www.w3.org/TR/html401/interact/forms.html#h-17.3>
 If you have a look at the console it should also trigger(post) after that.

Try this instead:

```
<form id="emailForm" name="emailForm">

```

And in js:

```
$('#emailForm').submit(function (e){
    // stop the default form submit behaviour
    e.preventDefault();
    $.ajax({
        url: "http://formspree.io/email1@gmail.com",
        method: "POST",
        data: $('#emailForm').serialize(),
        dataType: "json",
        success: function(result){
            $("#success").html("Message successfully sent");
        },
        error: function (request, status, error) {
            $("#success").html("Oops! Something went wrong. Please try again");
        }
    });
    return false
});

```