Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/javascript/421.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript post提交按钮php_Javascript_Php - Fatal编程技术网

Javascript post提交按钮php

Javascript post提交按钮php,javascript,php,Javascript,Php,我真的不知道为什么提交功能不起作用。我真的试图解决这个问题。有人知道为什么这样不行吗 <?php if(isset($_POST['submit'])){ echo ("submit funkt"); } else{ echo ("submit funkt nicht"); } ?> <form action="" method="get"> <div role="main" id="task-form-fill" class="ui-conte

我真的不知道为什么提交功能不起作用。我真的试图解决这个问题。有人知道为什么这样不行吗

<?php 
if(isset($_POST['submit'])){
    echo ("submit funkt");
}
else{
    echo ("submit funkt nicht");
}
?>

<form action="" method="get">
<div role="main" id="task-form-fill" class="ui-content">
    <label for="text-basic">Titel:</label>
    <input type="text" name="titel" id="titel" value="<?php $titel ?>">
    <label for="textarea">Beschreibung:</label>
    <textarea cols="40" rows="8" name="beschreibung" id="beschreibung" value="beschreibung"></textarea>
    <label for="date">End-Datum:</label>
    <input type="date" name="enddatum" id="datum" value="enddatum">
    <fieldset data-role="controlgroup" data-type="horizontal" data-mini="true">
        <legend>Prioritaet:</legend>
            <input type="radio" name="prio" id="radio-choice-c" value="hoch" checked="checked">
            <label for="radio-choice-c">Hoch</label>
            <input type="radio" name="prio" id="radio-choice-d" value="mittel">
            <label for="radio-choice-d">Mittel</label>
            <input type="radio" name="prio" id="radio-choice-e" value="niedrig">
            <label for="radio-choice-e">Niedrig</label>
    </fieldset>
   <button name="submit" class="ui-shadow ui-btn ui-corner-all" id="submit">Submit</button>
</form>    

请提及类型=提交按钮

  <button type="submit" name="submit" class="ui-shadow ui-btn ui-corner-all" id="submit">Submit</button>

正如其他人所提到的,如果您希望提交此表单,您应该具有以下内容:

<input type="submit" name="Submit" value="submit">
但是,表单不起作用的原因是顶行。改变

<form action="" method="get">


然后它就会工作。

要在按钮上提交表单,单击按钮类型应为submit

<input type='submit' name="submit" class="ui-shadow ui-btn ui-corner-all" id="submit" value='Submit'/>
谢谢。
M

使用change method=get to method=Post代替按钮,如果您的html页面中没有问题,您的表单必须在代码中发布。我们将方法更改为Post,但仍然不起作用,使用按钮代替输入的想法也不起作用。将表单方法更改为postchange echo submit funkt;死得很惨;相反我已经在我的机器上测试了你的代码,它运行得很好。用错误消息删除代码将确保文本不会出现在您看不到的地方。
<input type='submit' name="submit" class="ui-shadow ui-btn ui-corner-all" id="submit" value='Submit'/>