答案 0 :(得分:0)
尝试这样的事情。表单页面:
<form method="get" class="pryform" form action="phpfile.php">
<div class="form-group">
<label for="exampleInputName1">Name (optional, will be displayed)</label>
<textarea class="form-control" name="exampleInputName1" id="prnform" placeholder="Name" rows="1"></textarea>
</div>
<div class="form-group">
<label for="exampleInputDescription1">Description</label>
<textarea class="form-control" name="exampleInputDescription1" id="prdform" placeholder="Description" rows="3"></textarea>
</div>
<button type="submit" class="btn btn-default" id="button" name="submit" data-text-loading="Loading...">Submit</button>
</form>
和phpfile.php:
<?php
if (isset($_GET['submit'])) {
echo $_GET['exampleInputName1'] . "<br />";
echo $_GET['exampleInputDescription1'];
}
?>
答案 1 :(得分:0)
您必须为textarea指定name
。例如:
<textarea class="form-control" id="prnform" placeholder="Name" rows="1" name="name"></textarea>
和
<textarea class="form-control" id="prdform" placeholder="Description" rows="3" name="description"></textarea>
然后,您可以phpfile.php
$_GET['name']
和$_GET['description']
<h2><?= $_GET['name'] ?></h2>
<h1><?= $_GET['description'] ?></h1>
if (frm) {
disable = frm.$invalid;
if (frm.$invalid && frm.$error && frm.$error.required) {
frm.$error.required.forEach(function (error) {
disableArray.push(error.$name + ' is required');
});
}
}
if (disableArray.length > 0) {
vm.disableMessage = disableArray.toString();
}
答案 2 :(得分:0)
html代码: -
<form action="" method="post">
<textarea name="text" placeholder="enter the text here..."></textarea>
<input type="submit" name="submit" value="click here">
</form>
php代码: -
<?php
if(isset($_POST["submit"])){
echo $_POST["text"];
}
?>