Home > Web Front-end > JS Tutorial > body text

How to submit a form using js and pass parameters

高洛峰
Release: 2017-02-16 17:18:12
Original
1983 people have browsed it

The following editor will bring you an article on how to submit a js form and pass parameters. The editor thinks it is quite good, so I will share it with you now and give it as a reference for everyone. Let’s follow the editor to take a look.

//增加的函数 begin
function queryFun(){
  var type = $("#artType").val();
  var hasInputed = "1";//表示输入了要搜索 的信息
  if($("#query").val()=="选手姓名/编号"){
    //表示没有输入要搜索的值 
    hasInputed="0";
  }
   document.getElementById("queryForm").action="../news/starList.do?inputData="+hasInputed+"&artType="+type;
  document.getElementById("queryForm").submit();
}
//增加的函数 end
Copy after login

The above js submission form form and the implementation method of passing parameters are all the content shared by the editor. , I hope it can give you a reference, and I also hope that everyone will support the PHP Chinese website.

For more js submission form forms and implementation methods of passing parameters, please pay attention to the PHP Chinese website for related articles!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template