I make a login form and i use <button type="submit">
but it is not working.when i use the <input type="submit">
it totally works...Is there any method in java script to use the <button type="submit">
to submit the form?
<form class="modal-content animate" method="post">
<div class="imgcontainer">
<span onclick="document.getElementById('id01').style.display='none'" class="close" title="Close Modal">×</span>
</div>
<div class="container">
<label><b>Program name</b></label>
<input type="text" placeholder="Enter Program name" name="Pname" required>
<label><b>Authentication ID</b></label>
<input type="password" placeholder="Enter Authentication ID" name="psw" required>
<button type="submit" name="submit">Login</button>
<input type="checkbox" checked="checked"> Remember me
</div>
<?php
error_reporting(0);
session_start();
include("connection.php");
$Pname=$_POST['Pname'];
$psw=$_POST['psw'];
$_SESSION['$Pname']=$Pname;
if($_POST['submit'])
{
if($Pname=="" or $psw=="")
{
//echo '<p align="center" style="color:red">plz enter all info</p>';
}
else
{
$sql="select * from login where psw='$psw'";
$rData=mysql_query($sql);
$res=mysql_fetch_array($rData);
if($res['Pname']==$Pname && $res['psw']==$psw)
{
header("location:po.php?psw=$psw");
}
else
{
echo '<p align="center" style="color:red">invalid user name and password';
}
}
}
?>
here when i use <input type="submit" name="submit">
it works but when i use <button type="submit">
i doesn't work...so how can i use button to work?