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

How to change the encoding of MySQL database to utf8mb4

The utf8mb4 encoding is a superset of the utf8 en...

Detailed explanation of identifying files with the same content on Linux

Preface Sometimes file copies amount to a huge wa...

How to understand Vue's simple state management store mode

Table of contents Overview 1. Define store.js 2. ...

The connection between JavaScript and TypeScript

Table of contents 1. What is JavaScript? 2. What ...

Quick solution for forgetting MySQL8 password

Preface When we forget the MySQL database passwor...

Summary of basic usage of js array

Preface Arrays are a special kind of object. Ther...

Share the pitfalls of MySQL's current_timestamp and their solutions

Table of contents MySQL's current_timestamp p...

JavaScript ECharts Usage Explanation

I used ECharts when doing a project before. Today...

Example of creating table statements for user Scott in MySQL version of Oracle

Overview: Oracle scott user has four tables, whic...

Binary installation of mysql 5.7.23 under CentOS7

The installation information on the Internet is u...

WeChat Mini Program implements the likes service

This article shares the specific code for the WeC...

DIV common attributes collection

1. Property List Copy code The code is as follows:...