简体   繁体   English

来自模型的输入未包含在表单 POST 数据中

[英]Input from Model not included in form POST data

I have a simple HTML POST form with a model contained within like so:我有一个简单的 HTML POST 表单,其中包含一个模型,如下所示:

https://jsfiddle.net/pilotman/rn9gspz8/6/ https://jsfiddle.net/pilotman/rn9gspz8/6/

note: the JS fiddle is basic and just for demo and is not perfect.注意:JS fiddle 是基本的,仅用于演示,并不完美。

So when I submit the form and let the input inside the model has some text, my server script does not see 'input2'因此,当我提交表单并让模型内的输入有一些文本时,我的服务器脚本看不到“input2”

$_POST['input2'];

Does the data inside the model get sent with the POST data from the form?模型中的数据是否与表单中的 POST 数据一起发送? If not can it be done (I assume anything inside the form tag would be sent but I am clearly wrong)?如果不能这样做(我假设会发送表单标签内的任何内容,但我显然错了)?

Thanks谢谢

Your code is correct.你的代码是正确的。 as per your jsfiddle根据你的 jsfiddle

$_POST['input1']; is the normal input是正常输入

$_POST['input2']; is the popup model input field;是弹出模型输入字段;

在此处输入图片说明

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM