Sending form with Asp net mvc5

0

Hello, I have a form to send where the button is outside the form, this form has 50 different fields, I made in html and I need to receive this data via post in a C # controller, however I have no idea how to receive these Can someone give me a light? do not be surprised that the inputs are contained in a table.

@for (int i = 1; i < 51; i++)
{
    if (i < 10)
    {
        <tr>
            <div class="input-group input-group-sm justify-content-center row col-12">
                <td class="p-0">
                    <div class="input-group-prepend">
                        <span class="input-group-text" style="font-size:19px" id="inputGroup-sizing-sm">&nbsp;&nbsp;&nbsp;&nbsp; @i </span>

                    </div>
                </td>
                <td class="p-0">
                    <input type="text" name="inputN_@i" class="form-control form-control-lg" aria-label="Sizing example input" aria-describedby="inputGroup-sizing-sm">


                <td class="p-0">
                    <input type="text" name="inputN2_@i" class="form-control form-control-lg" aria-label="Sizing example input" aria-describedby="inputGroup-sizing-sm">
                </td>

            </div>
        </tr>
    }
    else
    {
        <tr>
            <div class="input-group input-group-sm justify-content-center ">
                <td class="p-0">
                    <div class="input-group-prepend">
                        <span class="input-group-text" style="font-size:19px" id="inputGroup-sizing-sm">&nbsp;&nbsp; @i </span>

                    </div>
                </td>
                <td class="p-0">
                    <input type="text" name="inputN_@i" class="form-control form-control-lg" aria-label="Sizing example input" aria-describedby="inputGroup-sizing-sm">


                <td class="p-0">
                    <input type="text" name="inputN2_@i" class="form-control form-control-lg" aria-label="Sizing example input" aria-describedby="inputGroup-sizing-sm">
                </td>

            </div>
        </tr>
    }
}
    
asked by anonymous 28.11.2018 / 12:30

1 answer

1

Just shoot the submit() of the form via javascript ...

let enviar = function(){
  document.getElementById("formulario").submit();
};
<form id="formulario">
  <input type="text" name="teste" value="teste" /> 
  
</form>
<hr/>
<input type="button" value="Submeter" onclick="enviar()"/>
    
28.11.2018 / 16:26