我已阅读本手册并遵循所有说明,但不起作用:(
数据确实打印在隐藏输入内(未隐藏在代码中以便进行测试)。但是,当我提交表单并尝试var_dump POST值时,我无法从隐藏字段中看到标签。
我添加了另一个名为“test”的文本字段,其字符串为“it works”。这个字段确实得到POST并显示在var_dump中......但不是隐藏字段!
这是我的代码:
<?php
$http = "https";
$domain = "ni-dieu-ni-maitre.com";
echo "<script type=\"text/javascript\" src=\"https://www.ni-dieu-ni-maitre.com/scripts/jquery-1.8.2.min.js\"></script>
<link rel=\"stylesheet\" href=\"$http://www.$domain/scripts/css/textext.core.css\" type=\"text/css\" />
<link rel=\"stylesheet\" href=\"$http://www.$domain/scripts/css/textext.plugin.tags.css\" type=\"text/css\" />
<link rel=\"stylesheet\" href=\"$http://www.$domain/scripts/css/textext.plugin.autocomplete.css\" type=\"text/css\" />
<link rel=\"stylesheet\" href=\"$http://www.$domain/scripts/css/textext.plugin.focus.css\" type=\"text/css\" />
<link rel=\"stylesheet\" href=\"$http://www.$domain/scripts/css/textext.plugin.prompt.css\" type=\"text/css\" />
<link rel=\"stylesheet\" href=\"$http://www.$domain/scripts/css/textext.plugin.arrow.css\" type=\"text/css\" />
<script src=\"$http://www.$domain/scripts/js/textext.core.js\" type=\"text/javascript\" charset=\"utf-8\"></script>
<script src=\"$http://www.$domain/scripts/js/textext.plugin.tags.js\" type=\"text/javascript\" charset=\"utf-8\"></script>
<script src=\"$http://www.$domain/scripts/js/textext.plugin.autocomplete.js\" type=\"text/javascript\" charset=\"utf-8\"></script>
<script src=\"$http://www.$domain/scripts/js/textext.plugin.suggestions.js\" type=\"text/javascript\" charset=\"utf-8\"></script>
<script src=\"$http://www.$domain/scripts/js/textext.plugin.filter.js\" type=\"text/javascript\" charset=\"utf-8\"></script>
<script src=\"$http://www.$domain/scripts/js/textext.plugin.focus.js\" type=\"text/javascript\" charset=\"utf-8\"></script>
<script src=\"$http://www.$domain/scripts/js/textext.plugin.prompt.js\" type=\"text/javascript\" charset=\"utf-8\"></script>
<script src=\"$http://www.$domain/scripts/js/textext.plugin.ajax.js\" type=\"text/javascript\" charset=\"utf-8\"></script>
<script src=\"$http://www.$domain/scripts/js/textext.plugin.arrow.js\" type=\"text/javascript\" charset=\"utf-8\"></script>";
echo "<textarea id=\"textarea\" rows=\"1\" style=\"width:500px\"></textarea>
<form action=\"test.php\" method=\"POST\" id=\"tags_form\">
<script type=\"text/javascript\">
$('#textarea').textext({
html: {
hidden: ('<input type=\"text\" name=\"tags\" style=\"position:relative; top:50px;\"/>')
},
plugins : 'tags prompt focus autocomplete ajax arrow',
tagsItems : [ 'Basic', 'JavaScript', 'PHP', 'Scala' ],
prompt : 'Add one...',
ajax : {
url : '$http://www.$domain/scripts/data.json',
dataType : 'json',
cacheResults : true
}
});
</script>
<br><br><br><input type=\"text\" name=\"test\" value=\"it works\">
<button type=\"submit\" form=\"tags_form\" value=\"Submit\">Submit</button>
</form>
";
echo "<br><br><br><br><br><br><br>";
print_r($_POST);
var_dump($_POST);
?>