<script>

//helper function to create the form
function getNewSubmitForm(){
var submitForm = document.createElement("FORM");
document.body.appendChild(submitForm);
submitForm.method = "POST";
return submitForm;
}

//helper function to add elements to the form
function createNewFormElement(inputForm, elementName, elementValue){
var newElement = document.createElement("<input name='"+elementName+"' type='hidden'>");
inputForm.appendChild(newElement);
newElement.value = elementValue;
return newElement;
}

//function that creates the form, adds some elements
//and then submits it
function createFormAndSubmit(){
var submitForm = getNewSubmitForm();
createNewFormElement(submitForm, "field1", "somevalue");
createNewFormElement(submitForm, "field2", "somevalue");
submitForm.action= "someURL";
submitForm.submit();
}
</script>

<input type="button" value="Click to create form and submit" onclick="createFormAndSubmit()">

http://blog.csdn.net/honey_claire/article/details/7658490

http://bbs.csdn.net/topics/300212131

http://bbs.csdn.net/topics/390693892

http://www.aa25.cn/code/458.shtml

最新文章

  1. vs增加第三方依赖库的方法总结
  2. dpkg
  3. JPEG格式
  4. 初识C++的类
  5. java从0开始学——数组,一维和多维
  6. Java 容器在实际项目开发中应用
  7. 构建Maven父子工程
  8. python之路——25
  9. GitLab CI with docker and dind &quot;mount: permission denied (are you root?)&quot;
  10. 通过 rufus 创建启动U盘,安装 VMWare Esxi
  11. C#应用jstree实现无限级节点的方法
  12. HDMI之(AVI)Auxiliary Video Information InfoFrame
  13. Tarjan&amp;&amp;缩点简析
  14. PHP5.3新特性
  15. ubuntu13.04更新源
  16. 简单JS旋转实现转盘抽奖效果
  17. hdu 1599 find the mincost route (最小环与floyd算法)
  18. ORM进阶之Hibernate 的三大对象
  19. 笔记-cookie参数
  20. JZOJ 5455. 【NOIP2017提高A组冲刺11.6】拆网线

热门文章

  1. Ubuntu下不重装系统安装SSD总结
  2. jquery 监听input输入值事件
  3. WideCharToMultiByte和MultiByteToWideChar函数的用法
  4. 用Navicat Premium 远程连接oracle数据库
  5. CSS3之绽放的花朵(网页效果--每日一更)
  6. 使用curl 下载HTML
  7. .NET跨平台实践:用C#开发Linux守护进程
  8. Hadoop笔记
  9. RCP: JDT 根据org.eclipse.jdt.core.IJavaElement对象获取org.eclipse.jdt.core.dom.ASTNode对象
  10. Python黑客编程基础3网络数据监听和过滤