I have created a form using jquery steps, and I want data that the user will fill to three different databases Practitioner, PractitionerSpecialty, PractitionerCompetenceLevel. After I finish the form I use form.submit(); to create request. but on the website is return 419 error I am not sure if I created the controller function correctly, it can be a reason for that.
My form in blade.php:
<form method="post" id="practitioner-form" action="/practitioner">
<h3>Practitioner</h3>
<section>
<legend>Practitioner Information</legend>
<div class="j-row">
<div class="j-unit" style="width: 45%; display: inline-block">
<label for="effective_date" class="j-label">{{trans('personalData.effectiveDate')}}</label>
<div class="input-group">
<input name="main_effective_date_create" id="main_effective_date_create"
type="date" class="form-control required">
</div>
</div>
<div class="j-unit" style="margin-left: 9%; width: 45%; display: inline-block">
<label for="expiry_date" class="j-label">{{trans('personalData.expiryDate')}}</label>
<div class="input-group">
<input name="main_expiry_date_create" id="main_expiry_date_create"
type="date" class="form-control">
</div>
</div>
</div>
<div class="j-row">
<div class="j-unit" style="width: 45%; display: inline-block">
<label for="phone" class="j-label">{{trans('personalData.phoneNumber')}}</label>
<div class="input-group">
<input name="main_phone_create" id="main_phone_create"
type="tel" class="form-control">
</div>
</div>
<div class="j-unit" style="margin-left: 9%; width: 45%; display: inline-block">
<label for="mobile" class="j-label">{{trans('personalData.mobileNumber')}}</label>
<div class="input-group">
<input name="main_mobile_create" id="main_mobil_create"
type="tel" class="form-control">
</div>
</div>
</div>
<div class="j-row">
<div class="j-unit">
<label for="email" class="j-label">{{trans('personalData.email')}}</label>
<div class="input-group">
<input name="main_email_create" id="main_email_create"
type="tel" class="form-control">
</div>
</div>
</div>
</section>
<h3>{{trans('settings.specialty')}}</h3>
<section>
<legend>{{trans('personalData.practitionersSpecialty')}}</legend>
<div class="j-row">
<label for="practitioner_specialty_id"
class="block">Select {{trans('settings.specialty')}}</label>
<select name="practitioner_specialty_id_create"
id="practitioner_specialty_id_create"
class="form-control">
#foreach($specialties as $specialty)
<option
value="{{$specialty->practitioner_specialty_id}}">{{$specialty->name}}</option>
#endforeach
</select>
</div>
<div class="j-row">
<div class="j-unit" style="width: 45%; display: inline-block">
<label for="effective_date_specialty"
class="j-label">{{trans('personalData.effectiveDate')}}</label>
<div class="input-group">
<input name="specialty_effective_date_create"
id="specialty_effective_date_create"
type="date" class="form-control required">
</div>
</div>
<div class="j-unit" style="margin-left: 9%; width: 45%; display: inline-block">
<label for="expiry_date_specialty" class="j-label">{{trans('personalData.expiryDate')}}</label>
<div class="input-group">
<input name="specialty_expiry_date_create" id="specialty_expiry_date_create"
type="date" class="form-control">
</div>
</div>
</div>
</section>
<h3>{{trans('settings.competenceLevel')}}</h3>
<section>
<legend>{{trans('personalData.practitionersCompetenceLevel')}}</legend>
<div class="j-row">
<label for="competence_level" class="block">{{trans('settings.competenceLevel')}}</label>
<select name="practitioner_competence_level_id_create"
id="practitioner_competence_level_id_create"
class="form-control">
#foreach($competence_levels as $level)
<option
value="{{$level->competence_level_id}}">{{$level->name}}</option>
#endforeach
</select>
</div>
<div class="j-row">
<div class="j-unit" style="width: 45%; display: inline-block">
<label for="effective_date_competence"
class="j-label">{{trans('personalData.effectiveDate')}}</label>
<div class="input-group">
<input name="competence_effective_date_create"
id="competence_effective_date_create"
type="date" class="form-control required">
</div>
</div>
<div class="j-unit" style="margin-left: 9%; width: 45%; display: inline-block">
<label for="expiry_date_competence" class="j-label">{{trans('personalData.expiryDate')}}</label>
<div class="input-group">
<input name="competence_expiry_date_create" id="competence_expiry_date_create"
type="date" class="form-control">
</div>
</div>
</div>
<div class="form-group row">
<div class="col-lg-12">
<label for="notes" class="block">{{trans('tables.notes')}}</label>
</div>
<div class="col-lg-12">
<textarea placeholder="Description" cols="80" rows="5" name="notes_create"></textarea>
</div>
</div>
</section>
</form>
Route for adding data to the database:
Route::post('/practitioner', 'CRUD\Settings\PractitionerController#storePractitioner')->name('addPractitioner');
Controller with storing function:
public function storePractitioner(Request $request, $id){
$practitioner_id = $this->practitionerRepository->getIdByPersonId($id);
$practitioner = Practitioner::where('person_id', $id);
$practitioner_specialty = PractitionerSpecialty::where('practitioner_id', $practitioner_id);
$practitioner_competence_level = PractitionerCompetenceLevel::where('practitioner_id', $practitioner_id);
$practitioner->effective_date=$request->get('main_effective_date_create');
$practitioner->expiry_date=$request->get('main_expiry_date_create');
$practitioner->phone=$request->get('main_phone_create');
$practitioner->mobile=$request->get('main_mobile_create');
$practitioner->email=$request->get('main_email_create');
$practitioner_specialty->practitioner_specialty_id=$request->get('practitioner_specialty_id_create');
$practitioner_specialty->effective_date=$request->get('specialty_effective_date_create');
$practitioner_specialty->expiry_date=$request->get('specialty_expiry_date_create');
$practitioner_competence_level->practitioner_competence_level_id=$request->get('practitioner_competence_level_id_create');
$practitioner_competence_level->effective_date=$request->get('competence_effective_date_create');
$practitioner_competence_level->expiry_date=$request->get('competence_expiry_date_create');
$practitioner_competence_level->notes=$request->get('notes_create');
return back()->with('success', 'New practitioner has been added');
}
something is missing on your form. add: {{ csrf_field() }} to the form after the form opening tag
Related
I've made a form for searching the bill number. When the bill is found in database table, the data should be shown in labels. How can I do that? Then the user press the button to pay for the billed amount.
view block
<form class="form-horizontal" method="POST" action="{{action('OrderedBookController#billPay')}}" enctype="multipart/form-data">
{{ csrf_field() }}
<div class="row" style="padding-left: 1%;">
<div class="col-md-4">
<div class="form-group">
<label>Bill Number</label><span class="required">*</span>
<input type="text" maxlength="15" required="required" autofocus="autofocus" autocomplete="off" name="NBillNumber" class="form-control"/>
</div>
</div>
<div class="col-md-4">
<div class="form-group"></div>
<div class="form-group" style="padding-left: 5%;">
<button type="submit" class="btn btn-primary">Search</button>
</div>
</div>
</div>
</form>
<div class="row" style="padding-left: 1%;">
<div class="col-md-4">
<div class="form-group">
<label>Book ID</label>
<output name="NBookID" class="form-control" aria-readonly="true"/>
</div>
<div class="form-group">
<label>Billed Date</label>
<output name="NBilledDate" class="form-control" aria-readonly="true"/>
</div>
</div>
<div class="col-md-4" style="padding-left: 3%;">
<div class="form-group">
<label>Billed Number</label>
<output name="NBilledNumber" class="form-control" aria-readonly="true"/>
</div>
<div class="form-group">
<label>Quantity</label>
<output name="NBilledQuantity" class="form-control" aria-readonly="true"/>
</div>
</div>
<div class="col-md-4"style="padding-left: 3%;">
<div class="form-group">
<label>Price</label>
<output name="NBilledPrice" class="form-control" aria-readonly="true"/>
</div>
<div class="form-group">
<label>Remarks</label>
<output name="NBilledRemarks" class="form-control" aria-readonly="true"/>
</div>
<div class="form-group">
<button type="submit" class="btn btn-primary">PAY</button>
</div>
</div>
</div>
OrderedBookController code block
public function searchBill()
{
return view ( 'pages.payBill');
}
public function billPay(Request $request)
{
$billNum = $request->input('NBillNumber');
if($billNum != ""){
$billsrch = OrderedBook::where ( 'BilledNum', $billNum )->get ();
if (count ( $billsrch ) > 0)
{
return response()->json($billsrch);
return view('pages.payBill', compact('billsrch'));
}
else
{
return view ( 'pages.payBill',compact('billsrch'))->with('alert-danger', 'Sorry No details found');
}
}
}
While debugging my billPay method, I am getting data from the database. Then how to show data in my view block. In previous forms I am displaying the data in a table, but now I need to show my data in form and update the paid column on button press PAY. How can I do this?
route code block
Route::get('/billSearch','OrderedBookController#searchBill');
Route::post('/billPay','OrderedBookController#billPay');
You have to display your html based on conditions like this.
if your form is post method you should process through ajax.
if your form is get method just put condition like this.
#if ($billsrch)
<form class="form-horizontal" method="POST" action="{{action('OrderedBookController#billPay')}}" enctype="multipart/form-data">
{{ csrf_field() }}
<div class="row" style="padding-left: 1%;">
<div class="col-md-4">
<div class="form-group">
<label>Bill Number</label><span class="required">*</span>
<input type="text" maxlength="15" required="required" autofocus="autofocus" autocomplete="off" name="NBillNumber" class="form-control"/>
</div>
</div>
<div class="col-md-4">
<div class="form-group"></div>
<div class="form-group" style="padding-left: 5%;">
<button type="submit" class="btn btn-primary">Search</button>
</div>
</div>
</div>
</form>
<div class="row" style="padding-left: 1%;">
<div class="col-md-4">
<div class="form-group">
<label>Book ID</label>
<output name="NBookID" class="form-control" aria-readonly="true"/>
</div>
<div class="form-group">
<label>Billed Date</label>
<output name="NBilledDate" class="form-control" aria-readonly="true"/>
</div>
</div>
<div class="col-md-4" style="padding-left: 3%;">
<div class="form-group">
<label>Billed Number</label>
<output name="NBilledNumber" class="form-control" aria-readonly="true"/>
</div>
<div class="form-group">
<label>Quantity</label>
<output name="NBilledQuantity" class="form-control" aria-readonly="true"/>
</div>
</div>
<div class="col-md-4"style="padding-left: 3%;">
<div class="form-group">
<label>Price</label>
<output name="NBilledPrice" class="form-control" aria-readonly="true"/>
</div>
<div class="form-group">
<label>Remarks</label>
<output name="NBilledRemarks" class="form-control" aria-readonly="true"/>
</div>
<div class="form-group">
<button type="submit" class="btn btn-primary">PAY</button>
</div>
</div>
</div>
#endif
I'm trying to re-arrange my input boxes to look something like this:
currently, they just go down one under each other
I tried using this code but all it did was make the boxes shorter
http://jsfiddle.net/aY9HC/
Here is my code
<style>
.fieldBlock
{
display: block;
width: 200px;
float: left;
}
</style>
here is the text box code
<div id="main-wrapper">
<div class="unix-login">
<div class="container-fluid">
<div class="row justify-content-center">
<div class="col-lg-4">
<div class="login-content card">
<center><h3>Register Account</h3>
<p><strong>Create Account</strong> » Purchase » Begin</p></center>
<div class="login-form">
<form data-toggle="validator" method="post" id="register_form">
<div class="form-group">
<div class="fieldBlock">
<label>Name</label>
<input id="username" type="name" name="name" class="form-control" placeholder="First & Last Name" required>
</div>
</div>
<div class="form-group">
<div class="fieldBlock">
<label>Age</label>
<input type="dob" id="age" name="age"class="form-control" placeholder="03/26/2001" required></div>
</div>
<div class="form-group">
<label>Email address</label>
<input id="email" type="email" name="email" class="form-control" placeholder="Email" data-error="This email is invalid" required>
<div class="help-block with-errors"></div>
</div>
<div class="form-group">
<label>Password</label>
<input id="password" type="password" name="password" class="form-control" placeholder="Password" data-minlength="8" data-error="Minimum of 8 characters" required>
<div class="help-block"></div>
</div>
<div class="form-group">
<label>Choose Your Course</label>
<select name="course" class="form-control">
<option value="0" selected>Texas Parent Taught Drivers Ed</option>
<option value="1">Texas Instructor Taught Drivers Ed</option>
<option value="2">Texas Adult Drivers Ed</option>
</select>
</div>
<div class="form-group">
<label>Referral</label>
<input id="referral" type="text" name="referral" class="form-control" placeholder="Referral Code" value="<?php echo $refer?>">
</div>
<div class="form-group checkbox">
<label>
<input id="policy" type="checkbox" data-error="Don't you agree?" required> Agree the terms and Privacy Policy
</label>
<div class="help-block with-errors"></div>
</div>
<button name="register" type="submit" class="btn btn-primary btn-flat m-b-30 m-t-30" >Register</button>
<div class="register-link m-t-15 text-center">
<p>Already have account? Sign in</p>
</div>
</form>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
All it did was keep the boxes under each other and make them a bit smaller. I'm a bit stuck right now. Help would be appericated. Thanks!
try adding
display:inline-block
on both text boxes.
Alternatively you can also try
display: flex;
You were on the right track with using float to move the elements next to each other. However, when elements are floating next to each other in a cramped space they will stack up by default. By making the parent container larger or smaller you can see how this works.
Also, there were a couple of missing fieldBlocks so the styles stop being applied.
I didn't want to take too much time on it but thought it would be fun to throw together a working sample from the code you provided. There's probably much more that could be cleaned up but hopefully it provides some insight.
http://jsfiddle.net/aY9HC/1373/
CSS
/* make a nice form wrapper */
#main-wrapper{
width:100%;
padding:1em;
}
#main-wrapper h3,
#main-wrapper p,
#main-wrapper button{
text-align:center;
margin-bottom:10px;
clear:left;
}
#main-wrapper button{
display:block;
position:relative;
left:45%;
}
/* Define our basic fieldBlock style / stagger rows */
.fieldBlock
{
width: 50%;
float: left;
margin-bottom:15px;
}
.fieldBlock input,
.fieldBlock select{
height:30px;
}
.fieldBlock input[type='checkbox']{
height:10px;
}
.fieldBlock:nth-of-type(3n){
width:100%;
}
.fieldBlock:nth-of-type(3n) input{
width:40%;
}
/* Define look for our labels */
.fieldBlock label{
font-weight:bold;
display:block;
margin-bottom:5px;
}
.fieldBlock .nonblock{
display:inline-block;
}
HTML
<div id="main-wrapper">
<h3>Register Account</h3>
<p><strong>Create Account</strong> » Purchase » Begin</p>
<form data-toggle="validator" method="post" id="register_form">
<div class="fieldBlock">
<label>Name</label>
<input id="username" type="name" name="name" class="form-control" placeholder="First & Last Name" required>
</div>
<div class="fieldBlock">
<label>Age</label>
<input type="dob" id="age" name="age"class="form-control" placeholder="03/26/2001" required>
</div>
<div class="fieldBlock">
<label>Email address</label>
<input id="email" type="email" name="email" class="form-control" placeholder="Email" data-error="This email is invalid" required>
<div class="help-block with-errors"></div>
</div>
<div class="fieldBlock">
<label>Password</label>
<input id="password" type="password" name="password" class="form-control" placeholder="Password" data-minlength="8" data-error="Minimum of 8 characters" required>
<div class="help-block"></div>
</div>
<div class="fieldBlock">
<label>Choose Your Course</label>
<select name="course" class="form-control">
<option value="0" selected>Texas Parent Taught Drivers Ed</option>
<option value="1">Texas Instructor Taught Drivers Ed</option>
<option value="2">Texas Adult Drivers Ed</option>
</select>
</div>
<div class="fieldBlock">
<label>Referral</label>
<input id="referral" type="text" name="referral" class="form-control" placeholder="Referral Code" value="<?php echo $refer?>">
</div>
<div class="fieldBlock checkbox">
<input id="policy" type="checkbox" data-error="Don't you agree?" required />
<label for="policy" class="nonblock">Agree the terms and Privacy Policy</label>
<div class="help-block with-errors"></div>
</div>
<button name="register" type="submit" class="btn btn-primary btn-flat m-b-30 m-t-30" >Register</button>
<p>Already have account? Sign in</p>
</form>
</div>
You can just use col classes
<div class='row'>
<div class='col'>Your first text box</div>
<div class='col'>Your second text box</div>
</div>
Try to use bootstrap grid (rows and cols) to organize input fields.
Example pattern:
<form data-toggle="validator" method="post" id="register_form">
<div class="row mx-0">
<div class="form-group col-6">
<div class="fieldBlock">
<label>Name</label>
<input id="username" type="name" name="name"
class="form-control"
placeholder="First & Last Name" required>
</div>
</div>
<div class="form-group col-6">
<div class="fieldBlock6">
<label>Age</label>
<input type="dob" id="age"
name="age"class="form-control"
placeholder="03/26/2001" required>
</div>
</div>
</div>
<div class="row mx-0">
<div class="form-group col-12">
<label>Email address</label>
<input id="email" type="email" name="email"
class="form-control" placeholder="Email"
data-error="This email is invalid" required>
<div class="help-block with-errors"></div>
</div>
</div>
</form
I have a background, but im also trying to get my form to just fit on the screen so it's not going past the screen.
Here is the code for the background image
<style>
body, html {
height: 100%;
margin: 0;
}
.bg {
/* The image used */
background-image: url("https://i.imgur.com/qnxtJse.jpg");
/* Full height */
height: 100%;
/* Center and scale the image nicely */
background-position: center;
background-repeat: no-repeat;
background-size: cover;
}
</style>
Here is the code for the form. You can vist https://drivealongapp.com/dashboard/page-register.php
And see what I'm talking about. I want it to just be in the image area. and not go past it.
<!-- Main wrapper -->
<div id="main-wrapper">
<div class="unix-login">
<div class="container-fluid">
<div class="row justify-content-center">
<div class="col-lg-4">
<div class="login-content card">
<center><h3>Register Account</h3>
<p><strong>Create Account</strong> » Purchase » Begin</p></center>
<div class="login-form">
<form data-toggle="validator" method="post" id="register_form">
<div class="form-group">
<label>Name</label>
<input id="username" type="name" name="name" class="form-control" placeholder="First & Last Name" required>
</div>
<div class="form-group">
<label>Age</label>
<input type="dob" id="age" name="age"class="form-control" placeholder="03/26/2001" required></div>
<div class="form-group">
<label>Email address</label>
<input id="email" type="email" name="email" class="form-control" placeholder="Email" data-error="This email is invalid" required>
<div class="help-block with-errors"></div>
</div>
<div class="form-group">
<label>Password</label>
<input id="password" type="password" name="password" class="form-control" placeholder="Password" data-minlength="8" data-error="Minimum of 8 characters" required>
<div class="help-block"></div>
</div>
<div class="form-group">
<label>Choose Your Course</label>
<select name="course" class="form-control">
<option value="0" selected>Texas Parent Taught Drivers Ed</option>
<option value="1">Texas Instructor Taught Drivers Ed</option>
<option value="2">Texas Adult Drivers Ed</option>
</select>
</div>
<div class="form-group">
<label>Referral</label>
<input id="referral" type="text" name="referral" class="form-control" placeholder="Referral Code" value="<?php echo $refer?>">
</div>
<div class="form-group checkbox">
<label>
<input id="policy" type="checkbox" data-error="Don't you agree?" required> Agree the terms and Privacy Policy
</label>
<div class="help-block with-errors"></div>
</div>
<button name="register" type="submit" class="btn btn-primary btn-flat m-b-30 m-t-30" >Register</button>
<div class="register-link m-t-15 text-center">
<p>Already have account? Sign in</p>
</div>
</form>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
I'm aiming for something like this:
I just removed all the labels. If you want to change something else let me know
<link href="https://stackpath.bootstrapcdn.com/bootstrap/4.1.1/css/bootstrap.min.css" rel="stylesheet"/>
<script src="https://code.jquery.com/jquery-3.3.1.slim.min.js"></script>
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.1.1/js/bootstrap.min.js"></script>
<!-- Main wrapper -->
<div id="main-wrapper">
<div class="unix-login">
<div class="container-fluid">
<div class="row justify-content-center">
<div class="col-lg-4">
<div class="login-content card">
<center>
<h3>Register Account</h3>
<p><strong>Create Account</strong> » Purchase » Begin</p>
</center>
<div class="login-form">
<form data-toggle="validator" method="post" id="register_form">
<div class="form-group">
<input id="username" type="name" name="name" class="form-control" placeholder="First & Last Name" required>
</div>
<div class="form-group">
<input type="dob" id="age" name="age" class="form-control" placeholder="AGE (03/26/2001)" required></div>
<div class="form-group">
<input id="email" type="email" name="email" class="form-control" placeholder="Email" data-error="This email is invalid" required>
<div class="help-block with-errors"></div>
</div>
<div class="form-group">
<input id="password" type="password" name="password" class="form-control" placeholder="Password" data-minlength="8" data-error="Minimum of 8 characters" required>
<div class="help-block"></div>
</div>
<div class="form-group">
<select name="course" class="form-control">
<option value="0" selected>CHOOSE COURSE</option>
<option value="1" selected>Texas Parent Taught Drivers Ed</option>
<option value="2">Texas Instructor Taught Drivers Ed</option>
<option value="3">Texas Adult Drivers Ed</option>
</select>
</div>
<div class="form-group">
<input id="referral" type="text" name="referral" class="form-control" placeholder="Referral Code" value="<?php echo $refer?>">
</div>
<div class="form-group checkbox">
<label>
<input id="policy" type="checkbox" data-error="Don't you agree?" required> Agree the terms and Privacy Policy
</label>
<div class="help-block with-errors"></div>
</div>
<button name="register" type="submit" class="btn btn-primary btn-flat m-b-30 m-t-30">Register</button>
<div class="register-link m-t-15 text-center">
<p>Already have account? Sign in</p>
</div>
</form>
</div>
</div>
</div>
</div>
</div>
At the moment I have this bootstrap login form which when you click Sign Up it switches to the sign up form. I've implemented the code for signing up in php along side some validation in PHP using $_POST to check to see if the fields are filled in and passwords match etc however, each time I submit the sign up for it switches back to the login form on the same page however, I want to it to remain on the sign up form if any of the validations fail. How would I go about doing this as simply changing the action="" in the form doesn't work. Here's the code for the bootrstrap login and sign up.
<div class="container">
<div id="loginbox" style="margin-top:50px;" class="mainbox col-md-6 col-md-offset-3 col-sm-8 col-sm-offset-2">
<div class="panel panel-info" >
<div class="panel-heading">
<div class="panel-title">Sign In</div>
<div style="float:right; font-size: 80%; position: relative; top:-10px">Forgot password?</div>
</div>
<div style="padding-top:30px" class="panel-body" >
<div style="display:none" id="login-alert" class="alert alert-danger col-sm-12"></div>
<form action="login.php" method="post" id="loginform" class="form-horizontal" role="form">
<h5 style="margin-top: 0px"><b>To place an order, please sign in.</b></h5>
<div id="error"></div>
<br>
<div style="margin-bottom: 25px" class="input-group">
<span class="input-group-addon"><i class="glyphicon glyphicon-user"></i></span>
<input id="login-username" type="text" class="form-control" name="username" value="" placeholder="username or email">
</div>
<div style="margin-bottom: 25px" class="input-group">
<span class="input-group-addon"><i class="glyphicon glyphicon-lock"></i></span>
<input id="login-password" type="password" class="form-control" name="password" placeholder="password">
</div>
<div class="input-group">
<div class="checkbox">
<label>
<input id="login-remember" type="checkbox" name="remember" value="1"> Remember me
</label>
</div>
</div>
<div style="margin-top:10px" class="form-group">
<!-- Button -->
<div class="col-sm-12 controls">
<p><input id="btn-login" class="btn btn-success" type="submit" name="submit" value="Login" /></p>
<input type="hidden" name="submitted" value="TRUE" />
</div>
</div>
<div class="form-group">
<div class="col-md-12 control">
<div style="border-top: 1px solid#888; padding-top:15px; font-size:85%" >
Don't have an account!
<a href="#" onClick="$('#loginbox').hide(); $('#signupbox').show()">
Sign Up Here
</a>
</div>
</div>
</div>
</form>
</div>
</div>
</div>
<div id="signupbox" style="display:none; margin-top:50px" class="mainbox col-md-6 col-md-offset-3 col-sm-8 col-sm-offset-2">
<div class="panel panel-info">
<div class="panel-heading">
<div class="panel-title">Sign Up</div>
<div style="float:right; font-size: 85%; position: relative; top:-10px"><a id="signinlink" href="#" onclick="$('#signupbox').hide(); $('#loginbox').show()">Sign In</a></div>
</div>
<div class="panel-body" >
<form action="" method="post" id="signupform" class="form-horizontal" role="form">
<div id="errorRegistration"></div>
<div id="signupalert" style="display:none" class="alert alert-danger">
<p>Error:</p>
<span></span>
</div>
<div class="form-group">
<label for="username" class="col-md-3 control-label">Username</label>
<div class="col-md-9">
<input type="text" class="form-control" name="newusername" placeholder="Username">
</div>
</div>
<div class="form-group">
<label for="email" class="col-md-3 control-label">Email</label>
<div class="col-md-9">
<input type="text" class="form-control" name="newemail" placeholder="Email Address">
</div>
</div>
<div class="form-group">
<label for="password" class="col-md-3 control-label">Password</label>
<div class="col-md-9">
<input type="password" class="form-control" name="newpassword" placeholder="Password">
</div>
</div>
<div class="form-group">
<label for="confirm-password" class="col-md-3 control-label">Confirm Password</label>
<div class="col-md-9">
<input type="password" class="form-control" name="newconfirm-password" placeholder="Confirm Password">
</div>
</div>
<div class="form-group">
<label for="forename" class="col-md-3 control-label">Forename</label>
<div class="col-md-9">
<input type="text" class="form-control" name="forename" placeholder="Forename">
</div>
</div>
<div class="form-group">
<label for="surname" class="col-md-3 control-label">Surname</label>
<div class="col-md-9">
<input type="text" class="form-control" name="surname" placeholder="Surname">
<div class="form-group">
<!-- Button -->
<div class="col-md-offset-3 col-md-9">
<p><input id="btn-signup" class="btn btn-info" type="submit" name="submittedRegister" value="  Sign Up" /></p>
<input type="hidden" name="submittedRegister" value="TRUE" />
</div>
</div>
</form>
</div>
</div>
</div>
</div>
Thanks again for the help! :D
There are many ways to do this, but a simple one would be something like this:
<div id="signupbox" style="<? if (empty($_POST['submittedRegister'])) echo 'display: none;' ?> margin-top:50px" class="mainbox col-md-6 col-md-offset-3 col-sm-8 col-sm-offset-2">
(And a modified version for #loginbox)
However, I don't recommend to use style attributes, if you can use classes. It might be easier, but classes help keeping the code clean and maintainable
I am working on a PHP based application in which we are getting large amount of data including more than 5 images. The code was working fine for many days but now it just stopped working. When we click the submit button the page reloads but the form does not submit to PHP POST Method. When i remove enctype from form then it gets submitted but the images doesn't pass. And with enctype it is only working with 3 images. if i increase the number of images it stops working.
Code of my application:
<form role="form" name="app_form" id="app_form" action="<?php echo $_SERVER['PHP_SELF']; ?>" method="post" enctype="multipart/form-data">
<div id="application_form"> <!-- Application Form Starts Here -->
<div class="container-fluid">
<div style="margin-top: 10px; border-top: 3px solid #37A8B3; padding-top: 10px;">
<div class="panel panel-default">
<div class="panel-body">
<div class="row">
<div class="col-md-12">
<div class="form-group" style="margin-top: 10px;">
<label class="control-label col-md-2" >Applied For:</label>
<div class="col-md-3">
<input type="text" class="form-control" name="app_for" id="app_for" required>
</div>
<label class="control-label col-md-1">ID No:</label>
<div class="col-md-2">
<input type="text" class="form-control" name="form_id" required>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="panel panel-default">
<div class="panel-body">
<div style="margin-bottom: 10px;">
<div class="row">
<div class="col-md-6">
<div class="form-group">
<label class="control-label col-md-4">Upload1:</label>
<div class="col-md-2">
<input type="file" name="Upload_1" id="Upload_1" required>
</div>
</div>
</div>
<div class="col-md-6">
<div class="form-group">
<label class="control-label col-md-4">Upload2:</label>
<div class="col-md-2">
<input type="file" name="Upload_2" id="Upload_2" required>
</div>
</div>
</div>
</div>
<br>
<div class="row">
<div class="col-md-6">
<div class="form-group">
<label class="control-label col-md-4">Upload3:</label>
<div class="col-md-2">
<input type="file" name="Upload_3" id="Upload_3" required>
</div>
</div>
</div>
<div class="col-md-6">
<div class="form-group">
<label class="control-label col-md-4">Upload4:</label>
<div class="col-md-2">
<input type="file" name="Upload_4" id="Upload_4" required>
</div>
</div>
</div>
</div>
<br>
<div class="row">
<div class="col-md-6">
<div class="form-group">
<label class="control-label col-md-4">Upload5:</label>
<div class="col-md-2">
<input type="file" name="Upload_5" id="Upload_5" required>
</div>
</div>
</div>
<div class="col-md-6">
<div class="form-group">
<label class="control-label col-md-4">Upload6:</label>
<div class="col-md-2">
<input type="file" name="Upload_6" id="Upload_6" required>
</div>
</div>
</div>
</div>
<br>
<div class="row">
<div class="col-md-6">
<div class="form-group">
<label class="control-label col-md-4">Upload7:</label>
<div class="col-md-2">
<input type="file" name="Upload_7" id="Upload_7" required>
</div>
</div>
</div>
</div>
</div>
</div>
<div style="background-color: #37A8B3;">
<h4 style="padding: 5px; color: white;"> PLEASE COMPLETE IN BLOCK CAPITALS </h4>
</div>
<div style="border-bottom: 3px solid #37A8B3;">
<div class="panel panel-default">
<div class="panel-body">
<div class="row">
<div class="col-md-12">
<div class="form-group">
<label class="control-label col-md-2 col-lg-2">Title Mr/Mrs/Ms/Other:</label>
<div class="col-md-1">
<select class="form-control" name="user_title" required>
<option value="">Select</option>
<option value="Mr">Mr</option>
<option value="Mrs">Mrs</option>
<option value="Ms">Ms</option>
<option value="other">Other</option>
</select>
</div>
<label class="control-label col-md-1" >First Name:</label>
<div class="col-md-2">
<input type="text" class="form-control" name="user_fname" required >
</div>
<label class="control-label col-md-1" >Mid Name:</label>
<div class="col-md-2">
<input type="text" class="form-control" name="user_midname">
</div>
<label class="control-label col-md-1" >Surname:</label>
<div class="col-md-2">
<input type="text" class="form-control" name="user_surname">
</div>
</div>
</div>
</div>
<br>
<div class="row">
<div class="col-md-12">
<div class="form-group">
<label class="control-label col-md-3" >Maiden/Former Name<small><i> (List all previous first names and surnames)</i></small>:</label>
<div class="col-md-9">
<input type="text" class="form-control" name="user_formername" required>
</div>
</div>
</div>
</div>
<br>
<div class="row">
<div class="col-md-12">
<div class="form-group">
<label class="control-label col-md-2" >Current Address:</label>
<div class="col-md-6 input-group-md">
<textarea class="form-control" name="user_curr_addr" rows="2" required></textarea>
</div>
<label class="control-label col-md-1" >Postcode:</label>
<div class="col-md-3 input-group-sm">
<input type="text" class="form-control" name="user_curr_post_code" required>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="row">
<div class="form-group">
<div class="col-md-12" style="margin-top: 20px; margin-bottom: 10px;">
<div class="col-md-2 col-md-offset-5">
<input type="submit" class="form-control btn btn-primary" name="submit_app" value="Submit Application">
</div>
</div>
</div>
</div>
<br>
<br>
<br>
</div>
</div>
</div>
</div>
</div> <!-- Application Form Ends Here -->
</form>
May be at first you tried small images and 5 pieces of small JPEGs didn't exceed your request size, then. Now, you're trying with bigger files and the total of your files are exceeding your request size value, thus you cannot complete your POST requests.
You should have got an error on the way somewherei though, but anyway.
I believe you should increase the request size in you PHP settings. Check the value of request size is bigger than the total size of files you're trying to POST.
I cannot provide you any code, because your question doesn't have any. I am just trying to help you out by pointing where to look.
EDIT:
As I am not a PHP expert, I know that the post size can be changed when you play with the "upload_max_filesize = xxM" and "post_max_size = xxM" which are located in the "PHP.ini" configuration file in your PHP installation directory. These are global values, though. If you're using a hosting panel, chances are you will find PHP specific settings in your panel. Just change or add these settings in order to override the global ones.