查看: 768|回复: 0

[文章教程] 动态创建表单并提交代码

[复制链接]
xuanxiao 发表于 2021-8-27 09:33:05 | 显示全部楼层 |阅读模式
  1. function checkJieshu()
  2. {
  3. // 创建一个 form
  4.     var form1 = document.createElement("form");
  5.     form1.id = "ttasp_jie";
  6.     form1.name = "ttasp_jie";

  7.     // 添加到 body 中
  8.     document.body.appendChild(form1);

  9.     // 创建一个输入
  10.     var input = document.createElement("input");
  11.     // 设置相应参数
  12.     input.type = "text";
  13.     input.name = "ttasp_memberID";
  14.     input.value = $("#memberID").val();
  15.         form1.appendChild(input);
  16.        
  17.         input.type = "text";
  18.     input.name = "ttasp_isbn";
  19.     input.value = $("#code_box").val().replace(/\n/g, "<br//>");
  20.     form1.appendChild(input);       
  21.     form1.method = "POST";   
  22.     form1.action = "jie.asp?act=jieshu";     
  23.     form1.submit();   
  24.     document.body.removeChild(form1);
  25. }
  26.   </script>
复制代码
您需要登录后才可以回帖 登录 | 注册

本版积分规则

快速回复 返回顶部 返回列表

在线客服

售前咨询
售后咨询
服务热线
023-58418553
微信公众号