1
Good morning, I have a form to send where the button is outside the form, this form has 50 different fields, I did in html and I need to receive this data via post in a controller c#, but I have no idea how to receive this data, can someone give me a light? no wonder 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"> @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"> @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>
}
}
If you are using MVC, it would be interesting to use a Submit (button) to post the form.
– Angelo Simonato
Unfortunately the client wants the button to be in another part of the screen totally out of the form, to revolve this I intend to send via javascript
– Jeison Guimarães
If the client asks... The nut and least bad solution in my view will be to call an ajax that will pick up your fields on the screen (Selecting your form).
– Angelo Simonato