This article mainly introduces how to implement JavaScript to receive the value of a form and put the value behind the form action. It involves techniques related to JavaScript dynamic operations on strings and form elements, and has some reference value, if you need it, refer to the example in this article to describe how js can receive the value of the form and spell the value after the form action. We will share this with you for your reference. The details are as follows:
Today, I encountered a problem. There are several inputs in the form, one of which is the input of the file to be uploaded. Now, when you click the submit button, add the input value that is not a file type to the format of & name = value after the action, so that it can be transmitted together.
Main js Code:
Function getParams () {var docList = document. getElementById ("inputList "). getElementsByTagName ("input"); var str = ""; // alert (docList. length); for (var I = 0; I
In this way, the value in the checkbox can be checked as 1, and 0 is not selected.
I hope this article will help you design JavaScript programs.