Php 在单输入文本中传递数组
我的表单中有这部分代码。这是一个动态输入文本 jquery:Php 在单输入文本中传递数组,php,ajax,Php,Ajax,我的表单中有这部分代码。这是一个动态输入文本 jquery: newdiv.innerHTML = '<label for=\'keywords\' style=\'display: inline; margin-left: 40px;\'><input type=\'text\' name=\'keywords[]\'></label> <a href=\'#\' onclick=\'removeElement("'+ divIdName +'")\'
newdiv.innerHTML = '<label for=\'keywords\' style=\'display: inline; margin-left: 40px;\'><input type=\'text\' name=\'keywords[]\'></label> <a href=\'#\' onclick=\'removeElement("'+ divIdName +'")\'> Remove</a>';
但是,我不知道如何使用dataString变量传递
关键字[]
。有人知道如何将其传递给join.php吗假定所有表单字段都是表单的一部分,您可以使用:
$.ajax({
type: "POST",
url: "join.php",
data: $("form").serialize(),
success: function(){
alert('hello world');
}});
这将发送所有表单值,而不仅仅是
名称
、用户名
和关键字
字段假设所有表单字段都是表单的一部分,您可以使用:
$.ajax({
type: "POST",
url: "join.php",
data: $("form").serialize(),
success: function(){
alert('hello world');
}});
这将发送所有表单值,而不仅仅是
名称
、用户名
和关键字
字段谢谢!我花了2个小时传递数据字符串,你给了我一行代码太好了!谢谢我花了2个小时传递数据字符串,你给了我一行代码太好了!