Several ways to submit HTML forms_PowerNode Java Academy

Several ways to submit HTML forms_PowerNode Java Academy

Method 1: Submit via the submit button

<!DOCTYPE html>
<html>
<head>
    <title>Submit via the submit button</title>
    <meta charset="UTF-8"/>
</head>
<body>
    <form action="" method="get" id="form1">
        <input type="text" name="username"></input>
        <input type="submit" value="Submit" />
    </form>
</body>
</html>

Method 2: Submit via a normal button

<!DOCTYPE html>
<html>
<head>
    <title>Submit via a regular button</title>
    <meta charset="UTF-8"/>
</head>
<body>
    <form action="" method="get" id="form1">
        <input type="text" name="username"></input>
        <input type="button" value="ok" name="sb" onclick="submit1();">
    </form>
    <script type="text/javascript">
        function submit1()
        {
            var form1 = document.getElementById("form1");
            form1.action = " bjpowernode.html";
            form1.submit();
        }
    </script>
</body>
</html>

Method 3: Submit via hyperlink

<!DOCTYPE html>
<html>
<head>
    <title>Submit via hyperlink</title>
    <meta charset="UTF-8"/>
</head>
<body>
    <a href="bjpowernode.html?username=张三">Submit via hyperlink</a> 
</body>
</html>

<<:  How to retrieve password for mysql 8.0.22 on Mac

>>:  Vue implements websocket customer service chat function

Recommend

Pure JS method to export table to excel

html <div > <button type="button&qu...

MySQL database aggregate query and union query operations

Table of contents 1. Insert the queried results 2...

MySQL uses init-connect to increase the implementation of access audit function

The mysql connection must first be initialized th...

Detailed explanation of HTML tables

Function: data display, table application scenari...

Detailed steps to install CentOS7 system on VMWare virtual machine

Pre-installation work: Make sure vmware workstati...

vue3 timestamp conversion (without using filters)

When vue2 converts timestamps, it generally uses ...

SVN installation and basic operation (graphic tutorial)

Table of contents 1. What is SVN 2. Svn server an...

Incomplete solution for using input type=text value=str

I encountered a very strange problem today. Look a...

Analyze the working principle of Tomcat

SpringBoot is like a giant python, slowly winding...

Issues and precautions about setting maxPostSize for Tomcat

1. Why set maxPostSize? The tomcat container has ...

Summary of MySQL database like statement wildcard fuzzy query

MySQL error: Parameter index out of range (1 >...

Implementing file content deduplication and intersection and difference in Linux

1. Data Deduplication In daily work, there may be...

Example of using UserMap in IMG

usemap is an attribute of the <img> tag, use...