Laravel Model Not Saving - mysql

Model is saving but all is null values excepts dates
There is not thrown error.
$fillable are directly copied from the field at my migrations.
I cant find why is that it is saving null values on the database
Here is my Code
My Model
<?php
namespace App;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\SoftDeletes;
class Disbursement_Information extends Model
{
use SoftDeletes;
protected $table = 'disbursement';
protected $fillable = [
'cv_number',
'payee_id',
'amount',
'check_number',
'release_date',
'first_collection_date',
'last_collection_date',
'maturity_date'
];
protected $dates = [
'created_at',
'updated_at',
'deleted_at'
];
}
My Controller
public function postDisbursement(Request $request, $id){
$loans = new Disbursement_Information;
$input = $request->all();
$loans->save($input);
}
HTML FORM
<div id="step-1">
<div class="row">
<div class="col-lg-12">
<h1 class="page-header"> List of All Clients</h1>
<h2>Total Clients: <b>3</b></h2>
<div class="row">
</div>
</div>
</div>
<!-- /.col-lg-12 -->
</div>
<hr>
<div class="col-lg-6 col-md-6">
<div class="form-group">
<label for="cv_number"> Check Voucher # </label>
<input type="text" class="form-control" name="cv_number" id="cv_number" required>
</div>
</div>
<div class="col-lg-6 col-md-6">
<div class="form-group">
<label for="check_number"> Check # </label>
<input type="text" class="form-control" name="check_number" id="check_number" required>
</div>
</div>
<div class="col-lg-6 col-md-6">
<div class="form-group">
<label for="first_collection_date"> First Payment </label>
<input type="date" class="form-control" name="first_collection_date" id="first_collection_date" required>
</div>
</div>
<div class="col-lg-6 col-md-6">
<div class="form-group">
<label for="last_collection_date"> Last Payment </label>
<input type="date" class="form-control" name="last_collection_date" id="last_collection_date" required>
</div>
</div>
<div class="col-lg-6 col-md-6">
<div class="form-group">
<label for="maturity_date"> Maturity Date </label>
<input type="date" class="form-control" name="maturity_date" id="maturity_date" required>
</div>
</div>
<div class="col-lg-6 col-md-6">
<div class="form-group">
<label for="payee_name"> Payee </label>
<input type="text" class="form-control" name="payee_name" id="payee_name" readonly>
<input type="hidden" class="form-control" name="payee_id" id="payee_id" required>
</div>
</div>
<input type="hidden" name="_token" value="JvvXJbloRAzQnj4oz4ve6Z8OLLia270Fs6utSO5a">
<table class="table table-striped">
<thead>
<th>Name</th>
<th style="">Loan Amount</th>
<th style="text-align:center">Action</th>
</thead>
<tbody>
<tr >
<td class="">
Morgado, Ashbee, Allego
</td>
<td>
<input type="number" min="2000" max="99000" name="loan_amount[1]" class="form-control loan-amount">
</td>
<td style="text-align:center">
<div class="radio">
<label><input type="checkbox" class="reloan" name="reloan[1]" p_id = "1 "p_name="Morgado, Ashbee, Allego" target-rdb="rdb1"> Not re-loaning/loaning </label>
<label id="rdb1"><input type="radio" class="rdbPayee" name="payee_id" value="1" p_name="Morgado, Ashbee, Allego">Mark As Payee</label>
<button type="button" class="btn btn-sm btn-default loan-summary"><i class="fa fa-info-circle fa-5" aria-hidden="true"></i></button>
</div>
</td>
</tr>
<tr >
<td class="">
Melton, Barbara, None
</td>
<td>
<input type="number" min="2000" max="99000" name="loan_amount[2]" class="form-control loan-amount">
</td>
<td style="text-align:center">
<div class="radio">
<label><input type="checkbox" class="reloan" name="reloan[2]" p_id = "2 "p_name="Melton, Barbara, None" target-rdb="rdb2"> Not re-loaning/loaning </label>
<label id="rdb2"><input type="radio" class="rdbPayee" name="payee_id" value="2" p_name="Melton, Barbara, None">Mark As Payee</label>
<button type="button" class="btn btn-sm btn-default loan-summary"><i class="fa fa-info-circle fa-5" aria-hidden="true"></i></button>
</div>
</td>
</tr>
<tr >
<td class="">
Bonyton, Ester, Jaxis
</td>
<td>
<input type="number" min="2000" max="99000" name="loan_amount[3]" class="form-control loan-amount">
</td>
<td style="text-align:center">
<div class="radio">
<label><input type="checkbox" class="reloan" name="reloan[3]" p_id = "3 "p_name="Bonyton, Ester, Jaxis" target-rdb="rdb3"> Not re-loaning/loaning </label>
<label id="rdb3"><input type="radio" class="rdbPayee" name="payee_id" value="3" p_name="Bonyton, Ester, Jaxis">Mark As Payee</label>
<button type="button" class="btn btn-sm btn-default loan-summary"><i class="fa fa-info-circle fa-5" aria-hidden="true"></i></button>
</div>
</td>
</tr>
</tbody>
</table>
<div class="modal-footer">
<button type="submit" class="btn btn-success"> Submit </button>
</div>
</div>

Related

how to pass the value of an object to another object, already as a variable in Angular?

My class Inbound looks like down bellow.
export class Inbound {
constructor(
public id: number,
public incomingType: string,
public quantity: number,
public location: string,
public arrived: Date,
public bin: Bin,
public truck: Truck,
public supplier: Supplier
) {
HTML ->
<tr>
<th>ID</th>
<th>Incoming Type</th>
<th>Quantity</th>
<th>Location</th>
<th>Arrived</th>
<th>Bin</th>
<th>Truck</th>
<th>Supplier</th>
</tr>
</thead>
<tbody>
<tr *ngFor="let inbound of inbounds">
<td><span>{{inbound.id}}</span></td>
<td><span>{{inbound.incomingType}}</span></td>
<td><span>{{inbound.quantity}}</span></td>
<td><span>{{inbound.location}}</span></td>
<td><span>{{inbound.arrived}}</span></td>
<td><span>{{inbound.bin.name}}</span></td>
<td><span>{{inbound.truck.regNumber}}</span></td>
<td><span>{{inbound.supplier.name}}</span></td>
<td>
I have problems with passing these 3 last variables because.
My code in Java works, i have checked on Postman.
Frontend in Angular meets some lack of knowledge by my side.
Method createNewInbound is not visible fron Angular.
<ng-template #content let-modal>
<div class="modal-header">
<h4 class="modal-title" id="modal-basic-title">New Inbound</h4>
<button type="button" class="close" aria-label="Close" (click)="modal.dismiss('Cross click')">
<span aria-hidden="true">×</span>
</button>
</div>
<div class="modal-body">
<form #f="ngForm" (ngSubmit)="onSubmit(f)" novalidate>
<div class="form-group">
<label for="incomingType">Incoming Type</label>
<div class="input-group">
<input id="incomingType" name="incomingType" class="form-control" ngModel>
</div>
</div>
<div class="form-group">
<label for="quantity">Quantity</label>
<div class="input-group">
<input id="quantity" name="quantity" class="form-control" ngModel>
</div>
</div>
<div class="form-group">
<label for="location">Location</label>
<div class="input-group">
<input id="location" name="location" class="form-control" ngModel>
</div>
</div>
<div class="form-group">
<label for="arrived">Arrived</label>
<div class="input-group">
<input id="arrived" name="arrived" class="form-control" ngModel>
</div>
***[FROM HERE !!!]
**</div>
<div class="form-group">
<label for="bin.name">Bin Name</label>
<div class="input-group">
<input id="bin.name" name="bin.name" class="form-control" ngModel>
</div>
</div>
<div class="form-group">
<label for="truck.regNumber">Truck Reg Number</label>
<div class="input-group">
<input id="truck.regNumber" name="truck.regNumber" class="form-control" ngModel>
</div>
</div>
<div class="form-group">
<label for="supplier.name">Supplier Name</label>
<div class="input-group">
<input id="supplier.name" name="supplier.name" class="form-control" ngModel>
</div>
[TILL HERE!!!]*****
</div>
<div class="border text-center">
<button data-dismiss="modal" class="btn btn-info">Submit</button>
</div>
</form>
</div>
I realize that it might looks like Butter butter and might be time-consuming.
If somobody is willing to help me it might be great New Year surpise for me.
Here is my repo -> https://github.com/sroko1/Shipping-Bins.git.
Have a good day & year.
I
You would need to make use of ngModelGroup directive. Below is the code snippet:
<div class="form-group" ngModelGroup="bin"> <!-- Added ngModelGroup="bin" -->
<label for="bin">Bin Name</label>
<div class="input-group">
<input id="bin" name="name" class="form-control" ngModel> <!-- Updated name attribute value -->
</div>
</div>
<div class="form-group" ngModelGroup="truck"> <!-- Added ngModelGroup="truck" -->
<label for="truck.regNumber">Truck Reg Number</label>
<div class="input-group">
<input id="truck.regNumber" name="regNumber" class="form-control" ngModel> <!-- Updated name attribute value -->
</div>
</div>
<div class="form-group" ngModelGroup="supplier"> <!-- Added ngModelGroup="supplier" -->
<label for="supplier.name">Supplier Name</label>
<div class="input-group">
<input id="supplier.name" name="name" class="form-control" ngModel> <!-- Updated name attribute value -->
</div>
</div>
This will help you to get expected f.value within onSubmit()

how to get data from one of the table rows

I tried to make a crud application, and stuck in the data update section, I don't know how to get data values ​​from one row of the table and bring them up in the input form to be edited.
This is my code
#model Web.Cifo.Cms.Models.AccountModel
<h2>Account</h2>
<hr />
<div class="row m-1">
<div class="col-md-push-4 mt-2 mr-5 ml-4">
<form method="post" asp-controller="home" asp-action="account">
<label for="uname">Username</label>
<input type="text" id="uname" asp-for="username" required="required" class="form-control" style="width:250px">
<label class="mt-2" for="pass">Password</label>
<input type="password" asp-for="password" required="required" id="pass" class="form-control" style="width:250px">
<label class="mt-2" for="name">Name</label>
<input type="text" id="name" asp-for="nama" required="required" class="form-control" style="width:250px">
<label class="mt-2" for="contact">Phone Number</label>
<input type="number" id="contact" asp-for="hp" required="required" class="form-control" style="width:250px">
<label class="mt-2" for="email">Email</label>
<input type="email" id="email" asp-for="email" required="required" class="form-control" style="width:250px">
<label class="mt-2" for="url">Profil Image Url</label>
<input type="text" id="url" asp-for="profil_image" required="required" class="form-control" style="width:250px">
<div class="row mt-2 pl-3">
<button type="submit" class="btn btn-dark">Add</button>
</div>
</form>
</div>
<div class="col-md-pull-8 m-1">
<h6>Select Table For Edit Or Delete</h6>
<!-- Editable table -->
<div class="card" style="overflow-x:scroll; overflow-y:scroll; height:50rem; width:70rem">
<h3 class="card-header text-center font-weight-bold text-uppercase py-4">Account</h3>
<div class="card-body mr-2">
<div id="table" class="table-editable">
<table class="table table-bordered table-responsive-md table-striped text-center" style="table-layout:fixed">
<thead>
<tr>
<th class="text-center" style="width:15rem">Action</th>
<th class="text-center" style="width:10rem">User Name</th>
<th class="text-center" style="width:10rem">Password</th>
<th class="text-center" style="width:10rem">Name</th>
<th class="text-center" style="width:15rem">Phone</th>
<th class="text-center" style="width:10rem">Email</th>
<th class="text-center" style="width:15rem">Profile Image Url</th>
</tr>
</thead>
<tbody>
#foreach (var acc in ViewBag.account)
{
<tr>
<td>
<a class="btn btn-danger btn-rounded btn-sm my-0" asp-controller="home" asp-action="deleteaccount" asp-route-id="#acc.username" onclick="return confirm ('Are You Sure ?')">Remove</a>
<a id="edtbtn" class="btn btn-danger btn-rounded btn-sm my-0">Edit</a>
</td>
<td class="pt-3-half">#acc.username</td>
<td class="pt-3-half">#acc.password</td>
<td class="pt-3-half">#acc.nama</td>
<td class="pt-3-half">#acc.hp</td>
<td class="pt-3-half">#acc.email</td>
<td class="pt-3-half">#acc.profil_image</td>
</tr>
}
</tbody>
</table>
</div>
</div>
</div>
<!-- Default input with help text-->
</div>
</div>
So, what I want is, when I press this edit button
<a id="edtbtn" class="btn btn-danger btn-rounded btn-sm my-0">Edit</a>
data from the selected row can be displayed here.
label for="uname">Username</label>
<input type="text" id="uname" asp-for="username" required="required" class="form-control" style="width:250px">
<label class="mt-2" for="pass">Password</label>
<input type="password" asp-for="password" required="required" id="pass" class="form-control" style="width:250px">
<label class="mt-2" for="name">Name</label>
<input type="text" id="name" asp-for="nama" required="required" class="form-control" style="width:250px">
<label class="mt-2" for="contact">Phone Number</label>
<input type="number" id="contact" asp-for="hp" required="required" class="form-control" style="width:250px">
<label class="mt-2" for="email">Email</label>
<input type="email" id="email" asp-for="email" required="required" class="form-control" style="width:250px">
<label class="mt-2" for="url">Profil Image Url</label>
<input type="text" id="url" asp-for="profil_image" required="required" class="form-control" style="width:250px">
I am totally new to this, please explain in a way that is easy to understand. thank you
Please refer to the following code snippet to dynamically populate tags with selected row data.
Html code
<a id="edtbtn" class="btn btn-danger btn-rounded btn-sm my-0" onclick="return edit_func(this);">Edit</a>
JavaScript code
<script>
//pass current row to function
function edit_func(row) {
//console.log($($(row).parent().siblings()[0]).text());
//get expected data from selected row
var username = $($(row).parent().siblings()[0]).text();
var password = $($(row).parent().siblings()[1]).text();
var nama = $($(row).parent().siblings()[2]).text();
var hp = $($(row).parent().siblings()[3]).text();
var email = $($(row).parent().siblings()[4]).text();
var profil_image = $($(row).parent().siblings()[5]).text();
//populate input(s) with selected row data
$("#uname").val(username);
$("#pass").val(password);
$("#name").val(nama);
$("#contact").val(hp);
$("#email").val(email);
$("#url").val(profil_image);
return false;
}
</script>
In account action
public IActionResult Account(AccountModel account)
{
//code logic here
//insert new record or update the existing one
//...
return View(model);
}

div tags doesn't remain fixed if page is zoomed in or zoomed out

I have a bootstrap template html code:
<section id="main-content">
<section class="wrapper">
<h3><i class="fa fa-angle-right"></i>Create New Space Marine Chapter</h3>
<div class="row mt" >
<div class="col-md-12" >
<div class="content-panel" >
<form class="form-inline" action="add.php" method="POST">
<div class="row">
<div class="form-group col-lg-5" style='float:initial;width:680px;height:240px'>
<div class="form-group col-lg-4">
<label for="id">ID:</label>
<input class="form-control" type="text" name="ID" required="required" />
</div>
<div class="form-group col-lg-4">
<label for="name">Name:</label>
<input class="form-control" type="text" name="Name" required="required"/>
</div>
<div class="form-group col-lg-4">
<label for="founding">Founding:</label>
<input class="form-control" type="text" name="Founding" required="required"/>
</div>
<div class="form-group col-lg-4">
<label for="successor_of">Successor Of:</label>
<input class="form-control" type="text" name="Successor_Of" required="required"/>
</div>
<div class="form-group col-lg-4">
<label for="successor_chapters">Successor Chapters:</label>
<input class="form-control" type="text" name="Successor_Chapters" required="required"/>
</div>
<div class="form-group col-lg-4">
<label for="number">Number:</label>
<input class="form-control" type="text" name="Number" required="required"/>
</div>
<div class="form-group col-lg-4">
<label for="primarch">Primarch:</label>
<input class="form-control" type="text" name="Primarch" required="required"/>
</div>
<div class="form-group col-lg-4">
<label for="chapter_master">Chapter Master:</label>
<input class="form-control" type="text" name="Chapter_Master" required="required"/>
</div>
<div class="form-group col-lg-4">
<label for="homeworld">Homeworld:</label>
<input class="form-control" type="text" name="Homeworld" required="required"/>
</div>
<div class="form-group col-lg-4">
<label for="allegiance">Allegiance:</label>
<input class="form-control" type="text" name="Allegiance" required="required"/>
</div>
<div class="form-group col-lg-4">
<label for="colors">Colors:</label>
<input class="form-control" type="text" name="Colors" required="required"/>
</div>
</div>
</div>
<br>
<div class="form-group col-md-1 ">
<button onclick="showAddRecordDiv()" type="submit" class="btn btn-default">Create</button>
</div>
</form>
<form action="javascript:getLastRecord();" method="GET">
<div class="form-group col-md-2">
<button type="submit" class="btn btn-default">Show Last Created</button>
</div>
</form>
<form action="javascript:getAllRecords();" method="GET">
<div class="form-group col-lg-1">
<button type="submit" class="btn btn-default">Show All</button>
</div>
</form>
<table id="advanced-table" class="table table-striped table-advance table-hover">
<thead>
<tr>
<th style="text-align:center" width="50">ID</th>
<th style="text-align:center" width="100">Name</th>
<th style="text-align:center" >Founding</th>
<th style="text-align:center" width="150">Successor Of</th>
<th style="text-align:center" width="200" >Successor Chapters</th>
<th style="text-align:center" >Number</th>
<th style="text-align:center" >Primarch</th>
<th style="text-align:center" width="200" >Chapter Master</th>
<th style="text-align:center" >Homeworld</th>
<th style="text-align:center" >Allegiance</th>
<th style="text-align:center" >Colors</th>
<th style="text-align:center" width="100" >Input Date</th>
<th style="text-align:center" >Delete</th>
</tr>
</thead>
<tbody>
</tbody>
</table>
<div id="alert-div" class="alert alert-danger" hidden="hidden">
<strong>RECORD DELETED</strong>
</div>
<div id="add-record-div" class="alert alert-success" hidden="hidden">
<strong>CHAPTER CREATED</strong>
</div>
</div><!-- /content-panel -->
</div><!-- /col-md-12 -->
</div><!-- /row -->
</section><! --/wrapper -->
</section><!-- /MAIN CONTENT -->
My problem is when I zoom in or out the page, all divs' positions changes and page's layout brakes. Here is some examples:
Page with size of 33%:
Page with size of 100%:
Page with size of 175%:
I searched over internet and saw that I must set divs' sizes fixed/static. I did something with float and width-height but it didn't help. What can I do for not to break page's layout?

Table column are not getting divided from center

This is how my page looks like.
This is code for same.
<table class="table table-bordered">
<tbody>
<tr>
<td>
<h4>Name & address</h4>
<div class="Name">
<input ng-model="Name" type="text" placeholder="Name" class="form-control"/>
</div>
<div class="Name">
<textarea class="form-control" ng-model="Address" placeholder="Address.." rows="4"></textarea>
</div>
<div class="Name">
<select ng-init="City=Chhatarpur" ng-model="City" class="form-control">
<option value="" ng-selected="selected">City</option>
<option value="Chhatarpur" ng-selected="selected">Chhatarpur</option>
</select>
</div>
<div class="Name">
<!--<input type="text" value="+91" class="form-control" size="2" disabled/>-->
<input ng-model="Mobile" type="text" placeholder="Mobile Number" class="form-control" maxlength="10"/>
</div>
</td>
<td>
<h4>Date/time of delivery</h4>
<div ng-if="(CurrentHour>=18 && CurrentHour<24) || (CurrentHour>=1 && CurrentHour<9)" >
<input type="radio" ng-model="order.delivery" value="5"> Tomorrow (09:00-12:00) <br/>
<input type="radio" ng-model="order.delivery" value="6"> Tomorrow (12:00-15:00) <br/>
<input type="radio" ng-model="order.delivery" value="7"> Tomorrow (15:00-18:00) <br/>
<input type="radio" ng-model="order.delivery" value="8"> Tomorrow (18:00-21:00)
</div>
<h4>Payment option </h4>
<input type="radio" ng-model="order.payment" value="Cash on delivery"> Cash on delivery <br/>
<input type="radio" ng-model="order.payment" value="Card on delivery"> Card on delivery
<button style="margin-top:20px;" type="button" class="btn btn-lg btn-primary btn-block" ng-click="">Place order</button>
</td>
</tr>
</tbody>
</table>
It looks like left column taking more width than right one. I want both columns should use 50% of screen width.
What is wrong here. Can some-one please help.
Give each td a width of 50%.
<table class="table table-bordered">
<tbody>
<tr>
<td width="50%">
<h4>Name & address</h4>
<div class="Name">
<input ng-model="Name" type="text" placeholder="Name" class="form-control"/>
</div>
<div class="Name">
<textarea class="form-control" ng-model="Address" placeholder="Address.." rows="4"></textarea>
</div>
<div class="Name">
<select ng-init="City=Chhatarpur" ng-model="City" class="form-control">
<option value="" ng-selected="selected">City</option>
<option value="Chhatarpur" ng-selected="selected">Chhatarpur</option>
</select>
</div>
<div class="Name">
<!--<input type="text" value="+91" class="form-control" size="2" disabled/>-->
<input ng-model="Mobile" type="text" placeholder="Mobile Number" class="form-control" maxlength="10"/>
</div>
</td>
<td width="50%">
<h4>Date/time of delivery</h4>
<div ng-if="(CurrentHour>=18 && CurrentHour<24) || (CurrentHour>=1 && CurrentHour<9)" >
<input type="radio" ng-model="order.delivery" value="5"> Tomorrow (09:00-12:00) <br/>
<input type="radio" ng-model="order.delivery" value="6"> Tomorrow (12:00-15:00) <br/>
<input type="radio" ng-model="order.delivery" value="7"> Tomorrow (15:00-18:00) <br/>
<input type="radio" ng-model="order.delivery" value="8"> Tomorrow (18:00-21:00)
</div>
<h4>Payment option </h4>
<input type="radio" ng-model="order.payment" value="Cash on delivery"> Cash on delivery <br/>
<input type="radio" ng-model="order.payment" value="Card on delivery"> Card on delivery
<button style="margin-top:20px;" type="button" class="btn btn-lg btn-primary btn-block" ng-click="">Place order</button>
</td>
</tr>
</tbody>
</table>
JSFiddle Here
use column width classes since you are using the class table table-bordered I guess you are using bootstrap css.
if you are using bootstrapv3.0 and above use below
<div class="col-md-6">
// LEFT COLUMN CODE GOES HERE
</div>
<div class="col-md-6">
// RIGHT COLUMN CODE GOES HERE
</div>
if you are using less than bootstrapv3.0
<div class="span6">
// LEFT COLUMN CODE GOES HERE
</div>
<div class="span6">
// RIGHT COLUMN CODE GOES HERE
</div>

Select value null after form submission

I have a form in which i toggle 'input text> with <select> using radio buttons. The problem is, i get the result back correctly when user enters value in <input text> but not with <select>.
Basically i'm sending searchType(the radio buttons that selects either the <input text> or the select) and searchKey(the values of <input text> or the select). When i use the <input text> the values are transferred after form submission whereas no values are transferred using select although the name is same for both. i.e searchKey
Can anyone please point out the fault in the code?
<div class="well">
<form class="form-horizontal" action="<%=request.getContextPath()%>/modules/singoliMandrini/ricerca/viewRicerca.jsp" method="post">
<fieldset>
<legend>Ricerca un mandrini</legend>
<div class="form-group" >
<label class="col-lg-2 control-label">Search by</label>
<div class="col-lg-6">
<div class="radio">
<label> <input onclick="showStuff('selection','status');" type="radio" name="searchType" value="id_singoli" />id mandrino</label>
</div>
<div class="radio">
<label> <input onclick="showStuff('selection','status');" type="radio" name="searchType" value="id_tipo" />id tipo</label>
</div>
<div class="radio">
<label> <input onclick="showStuff('selection','status');" type="radio" name="searchType" value="model" />model</label>
</div>
<div class="radio">
<label> <input onclick="showStuff('status','selection');" type="radio" name="searchType" value="status" />stato</label>
</div>
<div class="radio">
<label> <input onclick="showStuff('selection','status');" type="radio" name="searchType" value="linea" />linea</label>
</div>
</div>
</div>
<div class="form-group tempHide" id="selection">
<label for="inputEmail" class="col-lg-2 control-label">Search keywords</label>
<div class="col-sm-4">
<input type="text" class="form-control" name="searchKey" placeholder="keywords" />
</div>
</div>
<div class="form-group tempHide" id="status">
<label for="select" class="col-lg-2 control-label">Search keywords</label>
<div class="col-lg-4">
<select class="form-control input-sm" name="searchKey">
<option value="disponibile">disponibile</option>
<option value="montato">montato</option>
<option value="scrap">scrap</option>
</select>
</div>
</div>
</fieldset>
<p class="text-right">
<input class="btn btn-info" type="submit" value="Ricerca" name="ricerca" />
</p>
</form>
</div>
<% if(request.getParameter("ricerca")!=null) {
ricercaTipo ric = new ricercaTipo();
ArrayList<ricercaBean> list = new ArrayList<ricercaBean>();
list = ric.search(ricerca);
if(list.size()>0){
%>
<div class="well">
<table class="table table-striped table-hover ">
<thead>
<tr>
<th>#</th>
<th>id</th>
<th>Brand</th>
<th>Model</th>
<th>RPM</th>
<th>Nota</th>
</tr>
</thead>
<tbody>
<% for(int index=0;index<list.size();index++) { %>
<tr class="active">
<td><%=index+1%></td>
<td><%=list.get(index).getId_mandrino()%></td>
<td><%=list.get(index).getId_tipo()%></td>
<td><%=list.get(index).getModel()%></td>
<td><%=list.get(index).getTimeStamp()%></td>
<td><%=list.get(index).getStatus()%></td>
</tr>
<%} %>
</tbody>
</table>
</div>
<% }else{%>
<div class="alert alert-dismissable alert-danger">
<button type="button" class="close" data-dismiss="alert">×</button>
<strong>Oh No!</strong> No data found for the term "<%=ricerca.getSearchType()%>" <%=ricerca.getSearchKey()%>. Try again.
I am using Jsp Beans to send the data.
Your select dropdown and text input both have the same name so their value are mapped to the same variable on the bean. You should give them different names