When submitting one form from view, how can i also read or have controller read data in another form in same page?
When you submit a form with a browser, it will only send data for the fields within that <form></form>. This is true regardless of the back-end technology that you use, whether it be ASP.net, MVC.net, PHP, Python, etc.
The only two options I can really think of would be:
Of course, there's pros and cons to each, but that's the nature of the beast.
You could do it on the client-side with a combination of Ajax and Javascript...
<SCRIPT language="JavaScript">
function submitforms()
{
new Ajax.Request(formUrl,
{
parameters: $H({param1:value,param2:value}).toQueryString(),
method: 'post',
onSuccess: function(transport) {
document.myform.submit();
}
}
}
</SCRIPT>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With