How to implement html input drop-down menu

How to implement html input drop-down menu

Copy code
The code is as follows:

<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
</head>
<body>
<?php
echo '
<form name="DDForm" method="GET" action="">
<div style="position:relative;">
<span style="margin-left:100px;width:18px;overflow:hidden;">
<select style="width:180px;margin-left:-100px" onchange="this.parentNode.nextSibling.value=this.value" name="hh">
<option value="Car">Car</option>
<option value="Train"> Train</option>
<option value="Aircraft"> Aircraft</option>
</select>
</span><input name="box" style="width:160px;position:absolute;left:0px;">
<input value="Submit" name="submit" type="submit"/>
</div>
</form>';
$aa=$_GET['hh']."111"; // select the value of the drop-down menu
$bb=$_GET['box']."222"; // value of input box
echo $aa;
echo "</br>";
echo $bb;
// To get the value that can be entered into the drop-down menu, just get the value of the input box.
?>
</body>
</html>


To get the value that can be entered into the drop-down menu, just get the value of the input box.

Note: </span><input name="box" style="width:160px;position:absolute;left:0px;">

This line must be in one line and cannot be written as

</span>

<input name="box" style="width:160px;position:absolute;left:0px;">

After the line break, the value of the drop-down menu cannot be displayed in the input box.

It can also automatically select a matching menu value based on the input.

<<:  A Brief Analysis of Patroni in Docker Containers

>>:  Several specific methods of Mysql space cleaning

Recommend

Detailed explanation of the two modes of Router routing in Vue: hash and history

hash mode (default) Working principle: Monitor th...

How to use nodejs to write a data table entity class generation tool for C#

Although Microsoft provides T4 templates, I find ...

How to modify the default encoding of mysql in Linux

During the development process, if garbled charac...

MySQL trigger trigger add, delete, modify and query operation example

This article uses examples to describe the add, d...

Insufficient memory problem and solution when docker starts elasticsearch

question Insufficient memory when docker installs...

Detailed process of getting started with docker compose helloworld

Prerequisites Compose is a tool for orchestrating...

Implementation of Nginx forwarding matching rules

1. Regular expression matching ~ for case-sensiti...

Implementation example of uploading multiple attachments in Vue

Table of contents Preface Core code File shows pa...

React implements the sample code of Radio component

This article aims to use the clearest structure t...

The latest popular script Autojs source code sharing

Today I will share with you a source code contain...

TypeScript Enumeration Type

Table of contents 1. Overview 2. Digital Enumerat...

Hover zoom effect made with CSS3

Result:Implementation code: html <link href=&#...

Docker deploys Mysql, .Net6, Sqlserver and other containers

Table of contents Install Docker on CentOS 8 1. U...

Solve the problem of docker pull being reset

This article introduces how to solve the problem ...