There are two important concepts about forms
1. Design of the form
2. Posting data to backend script.
Bootstrap design of the form
In default design all inputs are stacked one over the other
All form input elements are with style =form-control occupies 100% of width
All form inputs along with the labels are kept within class=form-group
We can add form class=form-inline to keep all input elements in horizontal line using full available width.
Each form group behaves like a row so no need to keep one extra row tag to align inputs in a row.
You can read more on http POST method and http GET method of posting data to a backed script. We will discuss how to post data using JQuery serialize function and then display the response we get from the backend script.
Here is a form with a button to trigger data submission ( you will get retrun data from backend script )
Once the button is clicked we will trigger form submission process and receive the data from backend script by using JSON.
<?Php
error_reporting(0);// With this no error reporting will be there
$row=array("t1"=>"","t2"=>"","msg"=>"","status_form"=>"OK");
$msg='testing';
$t1=$_POST['userid'];
$t2=$_POST['password'];
////
// Your data processing scripts here ///
////
$msg="Userid : $t1 , Password : $t2 ";
$row["msg"]=$msg;
echo json_encode($row);
?>