I can't get the form method and submit button to work.

A

Anonymous

Guest
I can't get the form method and submit button to work.

After I click submit it wont navigate to myoffice.php

<!DOCTYPE html>
<html lang="en">
<head>

<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<title>Online Document Management - R & S IMPORT EXPORT LTD Portal Management</title>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1">

<link rel="icon" type="image/png" href="images/icons/favicon.ico">

<link rel="stylesheet" type="text/css"
href="vendor/bootstrap/css/bootstrap.min.css">

<link rel="stylesheet" type="text/css"
href="fonts/font-awesome-4.7.0/css/font-awesome.min.css">

<link rel="stylesheet" type="text/css"
href="fonts/Linearicons-Free-v1.0.0/icon-font.min.css">

<link rel="stylesheet" type="text/css"
href="vendor/animate/animate.css">

<link rel="stylesheet" type="text/css"
href="vendor/css-hamburgers/hamburgers.min.css">

<link rel="stylesheet" type="text/css"
href="vendor/animsition/css/animsition.min.css">

<link rel="stylesheet" type="text/css"
href="vendor/select2/select2.min.css">

<link rel="stylesheet" type="text/css"
href="vendor/daterangepicker/daterangepicker.css">

<link rel="stylesheet" type="text/css" href="css/util.css">
<link rel="stylesheet" type="text/css" href="css/main.css">

</head>
<body style="background-color: #666666;">
<div class="limiter">
<div class="container-login100">
<div class="wrap-login100">
<form class="login100-form validate-form">
<form method="post" action="myoffice.php">

<span class="login100-form-title p-b-43"> Login to continue </span>
<div class="wrap-input100 validate-input"
data-validate="Valid email is required: ex@abc.xyz"> <input
class="input100" name="email" type="text"> <span
class="focus-input100"></span> <span
class="label-input100">Email</span> </div>
<div class="wrap-input100 validate-input"
data-validate="Password is required"> <input
class="input100" name="pass" type="password"> <span
class="focus-input100"></span> <span
class="label-input100">Password</span> </div>
<div class="flex-sb-m w-full p-t-3 p-b-32">
<div class="contact100-form-checkbox"> <input
class="input-checkbox100" id="ckb1" name="remember-me"
type="checkbox"> <label class="label-checkbox100"
for="ckb1"> Remember me </label> </div>
<div> <br>
</div>
</div>
<div class="container-login100-form-btn">
<input type="submit" class="login100-form-btn" value="Enter"> </div>
<div class="text-center p-t-46 p-b-20"> <span class="txt2"><br>
</span> </div>
</form>
<div class="login100-more" style="background-image:
url('images/search.png');"> </div>
</div>
</div>
</div>

<script src="vendor/jquery/jquery-3.2.1.min.js"></script>

<script src="vendor/animsition/js/animsition.min.js"></script>

<script src="vendor/bootstrap/js/popper.js"></script>
<script src="vendor/bootstrap/js/bootstrap.min.js"></script>

<script src="vendor/select2/select2.min.js"></script>

<script src="vendor/daterangepicker/moment.min.js"></script>
<script src="vendor/daterangepicker/daterangepicker.js"></script>

<script src="vendor/countdowntime/countdowntime.js"></script>

<script src="js/main.js"></script>
</body>
</html>
 
I am sure that something goes wrong with what you are trying to do. Have you validated your code?
 
I do hope that you will be able to produce great results when solving this very problem! I will be crossing my fingers! for you to succeed
 
Hi,

I can't seem to workout what your trying to do. If you're trying to build a form of some kind, have a look at my very basic form below.
I've used html for the form, and php for the results.

HTML Code
Code:
<!DOCTYPE HTML>

<html>

<head>
  <title>Untitled</title>
</head>

<body>

<form name="myform" action="http://www.mywebsite.com/results.php" method="POST">
    <table>
        <tr>
            <td>Email</td>
            <td>Password</td>
        </tr>
        <tr>
            <td><input name="txtemail" type="email" size="30" placeholder="Enter Email Address"></td>
            <td><input name="txtpassword" type="password" size="20" placeholder="Password"></td>
        </tr>
    </table>
    <input name="cmdlogin" type="submit" value="Login">
</form>
</body>

</html>

and create a php file and name it results.php and use the following:
Code:
<?php
$login_email = $_POST["txtemail"];
$login_password = $_POST["txtpassword"];
echo "My email is: " . $login_email . "<br>My Password is:-" . $login_password;
?>

Hope this helps.
 
<form action="formHandler.php" name="yourForm" id="theForm" method="post">
<input type="text" name="fname" id="fname" />
<input type="submit" value="submit"/>
</form>
You need to ensure you have the submit button within the form tags, and an appropriate action assigned. Such as sending to a php file.
for more detail go stackoverflow and interviewqueries
 
Here's a couple of questions for you:

How long ago was this first posted?

How are you supposed to display code when posting on a forum?
 
Back
Top