javascript - html,通过document.write动态插入表单

标签 javascript html forms document.write

我正在尝试使用 document.write 动态插入表单,但由于某些原因,该表单不再有效。 这是调用 javascript http://pastebin.com/iMQ3FxHM 的代码这是编写表单 http://pastebin.com/vMn9BrKQ 的 javascript . 我正在使用 pastebin,因为 stackoverflow 不会转义 html 标签,而且我没有任何 1010 按钮或其他按钮

<script type="text/javascript">
    document.write('<scr' + 'ipt type="text\/jav' + 'ascript"  s' + 'rc="http:\/\/www.a' + 'utotraderuae.net\/mem' + 'bers.j' + 's"><\/sc' + 'ript>');
</script>

<script type="text/javascript">
document.write("<h1>");
document.write("    If you are interested to buy it or if you have any question please contact me through the ");
document.write("");
document.write("form bellow .<\/h1>");
document.write("<p>");
document.write("    <a name=\"contactustop\"><\/a><\/p>");
document.write("<form action=\"http:\/\/autotraderuae.net\/members\/process.php\" id=\"contactus\" method=\"POST\">");
document.write("    <strong><span style=\"font-size: 14px;\"><span style=\"font-family: ");
document.write("");
document.write("arial,helvetica,sans-serif;\"><label for=\"email\">Email *<\/label><\/span><\/span><\/strong><br \/>");
document.write("    <input class=\"textfield\" id=\"email\" name=\"fields[Email]\" style=\"width: 400px;\" type=\"text\" ");
document.write("");
document.write("\/>&nbsp;<\/form>");
document.write("<div class=\"fieldblock\" id=\"fieldblock-comments\">");
document.write("    <span style=\"font-family: arial,helvetica,sans-serif;\"><strong><span style=\"font-size: ");
document.write("");
document.write("14px;\"><label for=\"comments\">Your question<\/label><\/span><\/strong><\/span><br \/>");
document.write("    <textarea class=\"textfield\" cols=\"20\" id=\"comments\" name=\"fields[Comments]\" rows=\"4\" ");
document.write("");
document.write("style=\"width: 400px;\"><\/textarea><\/div>");
document.write("<p>");
document.write("    <button type=\"submit\">Submit<\/button><\/p>");

</script>

最佳答案

我看不到表单的结束标记。

此外,'bellow' 应该是 'below'

关于javascript - html,通过document.write动态插入表单,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3309075/

相关文章:

javascript - 在 Angular 2 中呈现一定数量的子组件

php - Laravel 路由方法问题

javascript - 将变量传递给 javascript 函数并在 document.form 中使用它?

javascript - 使用JQuery清除表单的所有内容

c# - 为windows窗体应用程序计算mysql数据库中一列的平均值

html - 在没有 photoshop 的情况下创建统一的提交、保存、取消按钮

javascript - 绑定(bind)事件的正确元素

javascript - google Oauth 登录 https 服务器

javascript - Node.js 中的路由模块出现 `Cannot GET/en/first` 错误

html - 如何使其中一个垂直对齐的 child 缩小到其他 child 设置的宽度?