Zend Ajax 实施后
我有一个带有选项的选择下拉列表:
<select id="select_privilege_section" name="select_privilege_section" onchange="">
<option value="pages">Pages</option>
<option value="forms">Forms</option>
<option value="roles">Roles</option>
<option value="cos">Change of Status</option>
</select>
我需要能够通过ajax将更改时选择的选项发送到要在那里检索的控制器中的特定操作,以便选择与必须显示的选项相关的表单:
var input = $(this).val();
$.ajax ({
type: "POST",
url: location.protocol + '//' + location.host + '/role/privilege/format/html',
data: {"form": input},
success: function(data) {
console.log("Success!!");
}
});
但我无法获得 $_POST['form'];
知道
为什么吗?
先感谢您!
I have a select dropdown with options:
<select id="select_privilege_section" name="select_privilege_section" onchange="">
<option value="pages">Pages</option>
<option value="forms">Forms</option>
<option value="roles">Roles</option>
<option value="cos">Change of Status</option>
</select>
I need to be able to send via ajax the option selected on change, to a specific action in a controller to be retrieved there in order to select which form related to the option it has to be displayed:
var input = $(this).val();
$.ajax ({
type: "POST",
url: location.protocol + '//' + location.host + '/role/privilege/format/html',
data: {"form": input},
success: function(data) {
console.log("Success!!");
}
});
But I am not being able to get the $_POST['form'];
there
Any idea why?
thank you in advance!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
如果我没记错的话,您发布的网址是错误的。尝试调试它并检查它是否是有效的 url。
The url you are posting to is wrong if I'm not mistaken. Try debugging it and check it is a valid url.