Can i change that from method Get to post

my question is can i change that from Get to Post method. with a script as document.getElementById.
I have already tried it I get undefined as an answer

my index.html

<!doctype html>
<html><head>
<meta charset="UTF-8">
<title>Untitled Document</title>
</head>
<body>
  
  <form action="display.html" method="get">
        <input type="text" name="serialNumber" value="12345">
        <input type="submit" value="Submit">
    </form>
    <div id="tp">
        <div id="MBU"></div>
    </div>

</body>
</html>

my display.html

<!doctype html>
<html><head>
<meta charset="UTF-8">
<title>Untitled Document</title>
</head>
<body>
   
  <input name="Afdeling" id="MBU" class="form-control m-b action" required="">
                      
  <script>
        function processForm(){
            var parameters = location.search.substring(1).split("&");
            var temp = parameters[0].split("=");
            l = unescape(temp[1]);
            document.getElementById("MBU").value = l;
            
        }
        processForm();
    </script>
</body>
</html>

What are you trying to achieve? Why have an html page process a form, when it just shows what was passed in the URL?

a little explanation I’m working on two form the first form you fill in the data after that to the second form but the data must remain in the second form

So, why two separate pages? Just use a single page and javascript to hide the first? Or more or a learning curve, but more maintainable, use something like angular and do a SPA with API’s?

or maybe a script for posting? it’s for a point scheme

I still don’t know what you are trying to do, other than send text to another form for some purpose.

Sponsor our Newsletter | Privacy Policy | Terms of Service