how can you use the link button to submit a form without ajax?
because i have problems using ajax.
If I use the classic
<input type="submit" value="Submit">
works the post variables are sent, but if I use
<a href="controllers/login.php" class="easyui-linkbutton" onclick="$('#flogin').submit();" style="width:80px">Submit</a>
the variables they are not sent or read.
code HTML index.php
<body>
<div id='win'>
<form id="flogin" action='controllers/login.php' method="post">
<div style="margin-bottom:20px ; margin-top:20px" >
<input id="user" type="text" name="utente">
</div>
<div style="margin-bottom:20px">
<input id="pwd" type="password" name="password">
</div>
<input type="hidden" id="dbinuso" value="frasema" />
<a href="javascript:void(0)" class="easyui-linkbutton" onclick="sublogin()" style="width:80px">Submit</a>
</form>
</div>
<script type="text/javascript" src="js/login.js"></script>
</body>
where #win is an window
code JAVASCRIPT login.js
function sublogin(){
$('#flogin').form('submit',{
success:function(data){
window.location.href = 'controllers/login.php';
}
})
code PHP login.php
<html>
<head>
<meta charset="UTF-8">
<title>Insert title here</title>
</head>
<body>
<?php
echo ($_POST['utente']);
?>
PAGINA 'login.php'
</body>
</html>
you only see: PAGINA 'login.php'
can anyone help me find a solution with or without ajax?