Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why does "<input>" element not post data?

Tags:

html

forms

input

The following page does send nothing in post request after pressing submit button:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
    <title>My title</title>
</head>
<body>


                <form id="myform" method="POST" action="save.php" >

                    <label for="title">Title: </label>
                    <input id="title" type="text" size="80" value="Damned"/>

                    <input type="submit">

                </form>


</body>
</html>

Why?

like image 314
Suzan Cioc Avatar asked Jul 15 '12 21:07

Suzan Cioc


People also ask

What does the input element do?

The <input> tag specifies an input field where the user can enter data. The <input> element is the most important form element. The <input> element can be displayed in several ways, depending on the type attribute.

Do input fields need to be in a form?

Yes, you can have a valid input without a form.

Should all inputs be wrapped in a form?

No you don't.


1 Answers

They disobey nothing. You must change

<input id="title"> 

to

<input id="title" name="somethingThatWillAppearIn$_POST">
like image 62
AM- Avatar answered Oct 17 '22 04:10

AM-