Camunda process could not be started - camunda

I Used this Script in my camunda form:
<form name="customerForm" role="form">
<script cam-script type="text/form-script">
var customerData = $scope.customerData = {
addresses : []
};
$scope.addAddress = function() {
customerData.addresses.push({});
};
camForm.on('form-loaded', function() {
camForm.variableManager.createVariable({
name: 'customerData',
type: 'Object',
value: customerData,
valueInfo: {
serializationDataFormat: 'application/json',
objectTypeName: 'org.camunda.bpm.spring.boot.example.twitter.CustomerData'
}
});
});
camForm.on('submit', function() {
angular.forEach(customerData.addresses, function(addr) {
delete addr.$$hashKey;
});
});
</script>
<h3>Customer Data</h3>
<div class="control-group">
<label class="control-label" for="firstname">First Name</label>
<div class="controls">
<input id="firstname"
class="form-control"
type="text"
required
ng-model="customerData.firstname">
</div>
</div>
<div class="control-group">
<label class="control-label" for="lastname">Last Name</label>
<div class="controls">
<input id="lastname"
class="form-control"
type="text"
required
ng-model="customerData.lastname">
</div>
</div>
<div class="control-group">
<label class="control-label" for="vip">Is VIP Customer</label>
<div class="controls">
<input id="vip"
class="form-control"
type="checkbox"
ng-model="customerData.vip">
</div>
</div>
<div>
<h3>Addresses</h3>
<a href
ng-click="addAddress()"
class="btn btn-default">Add</a>
<div ng-repeat="addr in customerData.addresses">
<hr>
<div class="control-group">
<label class="control-label" for="street">Street</label>
<div class="controls">
<input id="street"
class="form-control"
type="text"
required
ng-model="addr.street">
</div>
</div>
<div class="control-group">
<label class="control-label" for="zip">Zip</label>
<div class="controls">
<input id="zip"
class="form-control"
type="text"
required
ng-model="addr.zipCode">
</div>
</div>
<div class="control-group">
<label class="control-label" for="city">City</label>
<div class="controls">
<input id="city"
class="form-control"
type="text"
required
ng-model="addr.city">
</div>
</div>
<div class="control-group">
<label class="control-label" for="country">Country</label>
<div class="controls">
<select id="country"
class="form-control"
required
ng-model="addr.country">
<option>Germany</option>
<option>France</option>
<option>Italy</option>
<option>Luxembourg</option>
</select>
</div>
</div>
</div>
</div>
</form>
and I got this error
The process could not be started. :
Cannot instantiate process definition createRating:1:1eed70bf-e4ba-11ec-afcd-764adfcc4004: Cannot find serializer for value 'ObjectValue [value=null, isDeserialized=false, serializationDataFormat=application/json, objectTypeName=org.camunda.bpm.spring.boot.example.twitter.CustomerData, serializedValue=130 chars, isTransient=false]'.
how can I fix it?
Note: objectTypeName is correct I checked it

Most likely reason is that the distribution you are using does not include the CAMUNDA SPIN libraries.
See:
https://docs.camunda.org/manual/7.17/user-guide/data-formats/
and
https://docs.camunda.org/manual/7.17/user-guide/data-formats/json/
If you are using Maven, add:
<dependency>
<groupId>org.camunda.bpm</groupId>
<artifactId>camunda-engine-plugin-spin</artifactId>
</dependency>
<dependency>
<groupId>org.camunda.spin</groupId>
<artifactId>camunda-spin-dataformat-all</artifactId>
</dependency>

Related

Django form imageupload give empty dic

i am trying to create edit profile form, in which i am trying to data from edit profile form. i am getting all data in request.POST but i am getting empty {} using request.Files
view.py
class EditProfile(View):
template_name="todo_app/edit_profile.html"
def get(self,request,pk):
if request.user.is_authenticated:
user_id=pk
profile=UserProfile.objects.get(user=user_id)
content={
'profile':profile,
}
return render(request,self.template_name,content)
else:
return redirect('todo_app:login')
def post(self,request,pk):
request_data=request.POST
first_name=request_data.get('first_name')
last_name=request_data.get('last_name')
mob_no=request_data.get('mob_no')
address_1=request_data.get('address_1')
address_2=request_data.get('address_2')
gender=request_data.get('gender')
age=request_data.get('age')
state=request_data.get('state')
city=request_data.get('city')
country=request_data.get('country')
bio=request_data.get('bio')
# profile_pic=request.FILES['profile_pic']
print(request_data)
print("_"*123)
print(request.FILES)
return redirect('todo_app:edit_profile',pk)
and print result on console is
<QueryDict: {'csrfmiddlewaretoken': ['mkfuwR6Uc99svosQvsVpho11JOXOdESSmp2sm1ULDFrFu3UHRrkASTWeSyRwXyzH'], 'first_name': ['upasana'], 'last_name': ['kulshresths'], 'address_1': ['9 Purushottam Nagar'], 'address_2': ['Dayal Bagh'], 'mob_no': ['9087654321'], 'gender': ['Male'], 'age': ['12'], 'state': ['Uttar Pradesh'], 'city': ['Agra'], 'country': ['India'], 'bio': ['Contrary to popular belief, Lorem Ipsum is not simply random text. It has roots in a piece of classical Latin literature from 45 BC, making it over 2000 years old. Richard McClintock, a Latin professo'], 'profile_pic': ['Screenshot from 2021-07-14 16-44-31.png']}>
___________________________________________________________________________________________________________________________
<MultiValueDict: {}>
edit_profile.html
<form method="POST" action="{% url 'todo_app:edit_profile' profile.user.id %}" enctype="multipart/form-data">
{% csrf_token %}
<div class="form-row">
<div class="col-md-6 mb-3">
<label for="first_name">First name</label>
<input type="text" class="form-control" id="first_name" value="{{profile.user.first_name}}" name="first_name" required>
</div>
<div class="col-md-6 mb-3">
<label for="last_name">Last name</label>
<input type="text" class="form-control" id="last_name" value="{{profile.user.last_name}}" name="last_name" required>
</div>
<div class="col-md-6 mb-3">
<label for="address_1">Address line 1</label>
<input type="text" class="form-control" id="address_1" value="{{profile.address_line_1}}" name="address_1" required>
</div>
<div class="col-md-6 mb-3">
<label for="address_2">Address line 2</label>
<input type="text" class="form-control" id="address_2" value="{{profile.address_line_2}}" name="address_2" required>
</div>
</div>
<div class="form-row">
<div class="col-md-6 mb-3">
<label for="mobile_no">Mobile No</label>
<input type="number" min="6000000000" max="9999999999" value="{{profile.user.mob_no}}" class="form-control" id="mobile_no" name="mob_no" required>
</div>
<div class="col-md-3 mb-3">
<label for="gender">Gender</label>
<select class="custom-select" id="gender" name="gender" required>
<option>Male</option>
<option>Female</option>
<option>🏳️‍🌈</option>
</select>
</div>
<div class="col-md-3 mb-3">
<label for="age">Age</label>
<input type="number" min="0" max="120" value="{{profile.age}}" class="form-control" id="age" name="age" required>
</div>
</div>
<div class="form-row">
<div class="col-md-6 mb-3">
<label for="State" class="form-label">State</label>
<input type="text" class="form-control" id="State" name="state" value="{{profile.state}}">
</div>
<div class="col-md-3 mb-3">
<label for="city" class="form-label">City</label>
<input type="text" class="form-control" id="city" name="city" value="{{profile.city}}">
</div>
<div class="col-md-3 mb-3">
<label for="country" class="form-label">Country</label>
<input type="text" class="form-control" id="country" name="country" value="{{profile.country}}" >
</div>
</div>
<div class="form-row">
<div class="col-md-10 mb-3">
<label for="bio">Bio</label>
<textarea class="form-control" placeholder="Leave a comment here" id="bio" style="height: 100px" name="bio">{{profile.bio}}</textarea>
</div>
<div class="col-md-2 mb-3 ml-auto mt-4">
<img src="{{profile.profile_pic.url}}" class="rounded-circle" width="100px" alt="...">
</div>
</div>
<div class="input-group mb-3">
<div class="input-group-prepend">
<span class="input-group-text" id="profile_pc_spam">Profile Pic</span>
</div>
<div class="custom-file">
<input type="file" class="custom-file-input" id="profile_pic" name='profile_pic' >
<label class="custom-file-label" for="profile_pic">Choose file</label>
</div>
</div>
<div class="text-center">
<button class="btn my_button_delete mb-4 ustify-content-center" type="submit" >Submit form</button>
</div>
</form>
what am I doing wrong? i don't want to use django forms.
i try to search old question related this problem on stack overflow but i found that every one suggest using django form. if i missed any answer please tag me

One Bootstrap Modal affects the other

I have two bootstrap modals on a page. The first one (Modal_Add) will not work except if the second one (Modal_Edit) is first opened. The text boxes will not be clickable and nothing can be typed. But when I open the second one - without doing anything on it - and close, then open the first that was not working, it works. below are the codes
<!-- MODAL ADD -->
<form id="add_form" enctype="multipart/form-data">
<div class="modal fade" id="myModal" role="dialog" tabindex="-1" aria-labelledby="exampleModalLabelA" aria-hidden="true">
<div class="modal-dialog" >
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">×</span>
</button>
<h5 class="modal-title" id="exampleModalLabelB">Add New Member</h5>
</div>
<div class="modal-body">
<div class="container-fluid">
<input type="hidden" name="member_units" id="member_units" value="<?php if (isset($units_code)){echo $units_code;}?>" class="form-control">
<div class="row-fluid">
<div class="span6">
<div class="col-md-8">
<label class="col-form-label">Entrance Fee</label>
</div>
</div>
<div class="span6">
<div class="col-md-8">
<input type="text" name="entrance_amount" id="entrance_amount" class="form-control" placeholder="Entrance Fee">
<span id="entrance_amount_error" class="label label-important"></span>
</div>
</div>
</div>
<div class="row-fluid">
<div class="span6">
<label class="col-md-4 col-form-label">Member Name</label>
<div class="col-md-8">
<input type="text" name="member_name" id="member_name" class="form-control" placeholder="Name"> <span id="member_name_error" class="label label-important"></span>
</div>
</div>
<div class="span6">
<label class="col-md-4 col-form-label">Address</label>
<div class="col-md-8">
<input type="text" name="member_address" id="member_address" class="form-control" placeholder="Address">
</div>
</div>
</div>
<div class="row-fluid">
<div class="span6">
<label class="col-md-4 col-form-label">Member Phone</label>
<div class="col-md-8">
<input type="text" maxlength="11" name="member_phone" id="member_phone" class="form-control" placeholder="Phone">
<span id="member_phone_error" class="label label-important"></span>
</div>
</div>
<div class="span6">
<label class="col-md-4 col-form-label">Gender Status</label>
<div class="col-md-8">
<select name="gender_status" id="gender_status" class="form-control tooltips" data-trigger="hover" data-original-title="choose a Gender Status" >
<option value="0">--select--</option>
<option value="male">Male</option>
<option value="female">Female</option>
<option value="company">Company</option>
<option value="society">Society</option>
</select>
<span id="gender_status_error" class="label label-important"></span>
</div>
</div>
</div>
<div class="row-fluid">
<div class="span6">
<label class="col-md-4 col-form-label">Banker</label>
<div class="col-md-8">
<input type="text" name="banker" id="banker" class="form-control" placeholder="Banker">
<span id="banker_error" class="label label-important"></span>
</div>
</div>
<div class="span6">
<label class="col-md-4 col-form-label">Account Number</label>
<div class="col-md-8">
<input type="text" name="accountno" id="accountno" class="form-control" placeholder="Account Number" maxlength="10">
<span id="accountno_error" class="label label-important"></span>
</div>
</div>
</div>
<div class="row-fluid">
<div class="span6">
<label class="col-md-4 col-form-label" id="g-label">Guarantors</label>
<div class="col-md-8">
<select data-placeholder="Type Guarantors" name="guarantors[]" id="guarantors" class="chosen" multiple="multiple">
<!-- <option value="0">A</option> -->
</select>
</div>
</div>
<div class="span6">
<label class="col-md-4 col-form-label">Means of ID</label>
<div class="col-md-8">
<input type="text" maxlength="11" name="id_means" id="id_means" class="form-control" placeholder="Type your NIN">
<span id="id_means_error" class="label label-important"></span>
</div>
</div>
</div>
<div class="row-fluid">
<div class="span6">
<label class="col-md-4 col-form-label">Date Joined</label>
<div class="col-md-8">
<input type="date" name="date_joined" id="date_joined" class="form-control datepicker" value="<?php echo date('Y-m-d'); ?>">
</div>
</div>
<div class="span6">
<label class="col-md-4 col-form-label">Upload Passport</label>
<div class="col-md-8">
<input type='file' name='userfile' size='20' />
</div>
</div>
</div>
</div>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-secondary" data-dismiss="modal">Close</button>
<button type="submit" id="btn_save" class="btn btn-primary">Save</button>
</div>
</div>
</div>
</div>
</form>
<!--END MODAL ADD-->
<!-- MODAL EDIT -->
<form id="edit_form" enctype="multipart/form-data">
<div class="modal fade" id="Modal_Edit" role="dialog" tabindex="-1" aria-labelledby="exampleModalLabelE" aria-hidden="true">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">×</span>
</button>
<h5 class="modal-title" id="exampleModalLabelF">Edit Member</h5>
</div>
<div class="modal-body">
<div class="container-fluid">
<input type="hidden" name="member_units" id="member_units" value="<?php if (isset($units_code)){echo $units_code;}?>" class="form-control">
<div class="row-fluid">
<label class="col-md-4 col-form-label">Union Code</label>
<div class="col-md-8">
<input type="hidden" name="member_code_edit" id="member_code_edit" class="form-control" placeholder="Member Code" readonly>
<input type="text" name="union_code_edit" id="union_code_edit" class="form-control" placeholder="Union Code" readonly>
</div>
</div>
<div class="row-fluid">
<div class="span6">
<label class="col-md-4 col-form-label">Member Name</label>
<div class="col-md-8">
<input type="text" name="member_name_edit" id="member_name_edit" class="form-control" placeholder="Name">
<span id="member_name_edit_error" class="label label-important"></span>
</div>
</div>
<div class="span6">
<label class="col-md-4 col-form-label">Address</label>
<div class="col-md-8">
<input type="text" name="member_address_edit" id="member_address_edit" class="form-control" placeholder="Address">
</div>
</div>
</div>
<div class="row-fluid">
<div class="span6">
<label class="col-md-4 col-form-label">Member Phone</label>
<div class="col-md-8">
<input type="text" maxlength="11" name="member_phone_edit" id="member_phone_edit" class="form-control" placeholder="Phone">
<span id="member_phone_edit_error" class="label label-important"></span>
</div>
</div>
<div class="span6">
<label class="col-md-4 col-form-label">Means of ID</label>
<div class="col-md-8">
<input type="text" maxlength="11" name="id_means_edit" id="id_means_edit" class="form-control" placeholder="Type your NIN">
<span id="id_means_edit_error" class="label label-important"></span>
</div>
</div>
</div>
<div class="row-fluid">
<div class="span6">
<label class="col-md-4 col-form-label">Banker</label>
<div class="col-md-8">
<input type="text" name="banker_edit" id="banker_edit" class="form-control" placeholder="Banker">
<span id="banker_edit_error" class="label label-important"></span>
</div>
</div>
<div class="span6">
<label class="col-md-4 col-form-label">Account Number</label>
<div class="col-md-8">
<input type="text" name="accountno_edit" id="accountno_edit" class="form-control" placeholder="Account Number" maxlength="10">
<span id="accountno_edit_error" class="label label-important"></span>
</div>
</div>
</div>
<div class="row-fluid">
<div class="span6">
<label class="col-md-4 col-form-label">Date Joined</label>
<div class="col-md-8">
<input type="date" name="date_joined_edit" id="date_joined_edit" class="form-control datepicker" value="" readonly="">
</div>
</div>
<div class="span6">
<label class="col-md-4 col-form-label">Upload Passport</label>
<div class="col-md-8">
<input type='file' name='userfile_edit' size='20'/>
</div>
</div>
</div>
<div class="row-fluid">
<div class="span6">
<label class="col-md-4 col-form-label" id="g-label">Current Guarantors</label>
<div class="col-md-8">
<div id="current_gurantors"></div>
<!-- <option value="0">A</option> -->
</div>
</div>
<div class="span6">
<label class="col-md-4 col-form-label" id="g-label">Guarantors</label>
<div class="col-md-8">
<select data-placeholder="Type Guarantors" name="guarantors_edit[]" id="guarantors_edit" class="chosen" multiple="multiple">
<!-- <option value="0">A</option> -->
</select>
</div>
</div>
</div>
</div>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-secondary" data-dismiss="modal">Close</button>
<button type="submit" id="btn_update" class="btn btn-primary">Update</button>
</div>
</div>
</div>
</div>
</form>
<!--END MODAL EDIT-->
However, when i put the code for Modal_Edit on top of the code for Modal_Add, the problem affects Modal_Edit and vice versa
Edited
when I copied the code to https://www.codeply.com/p?starter=Bootstrap it works fine. What could be the problem?

Can anyone told me how to prevent to store blank input field of multiple input in Django Models

In my form there are multiple input field means there are two fieldset in which same input fields are available and i want to store both that input into models in different ids. It is working but when i filled only one input field and click on submit button then the second one is also stored blank but i want to prevent it. It's means that i only want to store filled input field into model and blank one will not not stored.
My Form.html
<form class="well form-horizontal" method="post" action="{% url 'fixed_doclist' %}">
{% csrf_token %}
<fieldset>
<div class="form-group">
<label class="col-md-4 control-label">Document Name</label>
<div class="col-md-6 inputGroupContainer">
<div class="input-group"><span class="input-group-addon"><i class="glyphicon glyphicon-user"></i></span><input id="fullName" name="dname" placeholder="Full Name" class="form-control" value="" type="text"></div>
</div>
</div>
<div class="form-group">
<label class="col-md-4 control-label">Exp Date</label>
<div class="col-md-6 inputGroupContainer">
<div class="input-group"><span class="input-group-addon"><i class="glyphicon glyphicon-home"></i></span><input id="postcode" name="exp" placeholder="Postal Code/ZIP" class="form-control" value="" type="text"></div>
</div>
</div>
<div class="form-group">
<label class="col-md-4 control-label">Renewal Date</label>
<div class="col-md-6 inputGroupContainer">
<div class="input-group"><span class="input-group-addon"><i class="glyphicon glyphicon-home"></i></span><input id="postcode" name="renewdt" placeholder="Postal Code/ZIP" class="form-control" value="" type="text"></div>
</div>
</div>
<div class="form-group">
<label class="col-md-4 control-label">Purpose</label>
<div class="col-md-6 inputGroupContainer">
<div class="input-group"><span class="input-group-addon"><i class="glyphicon glyphicon-home"></i></span><input id="state" name="purpose" placeholder="State/Province/Region" class="form-control" value="" type="text"></div>
</div>
</div>
<div class="form-group">
<label class="col-md-4 control-label">Remarks</label>
<div class="col-md-6 inputGroupContainer">
<div class="input-group"><span class="input-group-addon"><i class="glyphicon glyphicon-envelope"></i></span><input id="email" name="remark" placeholder="Email" class="form-control" value="" type="text"></div>
</div>
</div>
</fieldset><br/><br/>
<fieldset>
<div class="form-group">
<label class="col-md-4 control-label">Document Name</label>
<div class="col-md-6 inputGroupContainer">
<div class="input-group"><span class="input-group-addon"><i class="glyphicon glyphicon-user"></i></span><input id="fullName" name="dname1" placeholder="Full Name" class="form-control" value="" type="text"></div>
</div>
</div>
<div class="form-group">
<label class="col-md-4 control-label">Exp Date</label>
<div class="col-md-6 inputGroupContainer">
<div class="input-group"><span class="input-group-addon"><i class="glyphicon glyphicon-home"></i></span><input id="postcode" name="exp1" placeholder="Postal Code/ZIP" class="form-control" value="" type="text"></div>
</div>
</div>
<div class="form-group">
<label class="col-md-4 control-label">Renewal Date</label>
<div class="col-md-6 inputGroupContainer">
<div class="input-group"><span class="input-group-addon"><i class="glyphicon glyphicon-home"></i></span><input id="postcode" name="renewdt1" placeholder="Postal Code/ZIP" class="form-control" value="" type="text"></div>
</div>
</div>
<div class="form-group">
<label class="col-md-4 control-label">Purpose</label>
<div class="col-md-6 inputGroupContainer">
<div class="input-group"><span class="input-group-addon"><i class="glyphicon glyphicon-home"></i></span><input id="state" name="purpose1" placeholder="State/Province/Region" class="form-control" value="" type="text"></div>
</div>
</div>
<div class="form-group">
<label class="col-md-4 control-label">Remarks</label>
<div class="col-md-6 inputGroupContainer">
<div class="input-group"><span class="input-group-addon"><i class="glyphicon glyphicon-envelope"></i></span><input id="email" name="remark1" placeholder="Email" class="form-control" value="" type="text"></div>
</div>
</div>
</fieldset>
<button>Submit</button>
</form>
View.py File
def fixed_doclist(request):
print("Form is submitted successfully!")
dname = request.POST.get("dname", False)
exp = request.POST.get("exp", False)
renewdt = request.POST.get("renewdt", False)
purpose = request.POST.get("purpose", False)
remark = request.POST.get("remark", False)
dname1 = request.POST.get("dname1", False)
exp1 = request.POST.get("exp1", False)
renewdt1 = request.POST.get("renewdt1", False)
purpose1 = request.POST.get("purpose1", False)
remark1 = request.POST.get("remark1", False)
DocFixed = Doc.objects.bulk_create([Doc(dname = dname, exp = exp, renewdt = renewdt, purpose = purpose, remark = remark),Doc(dname = dname1, exp = exp1, renewdt = renewdt1, purpose = purpose1, remark = remark1)])
return render(request,'fixeddoclist.html')
Model.Py File
class Doc(models.Model):
dname = models.CharField(max_length=20)
exp = models.CharField(max_length=10)
renewdt = models.CharField(max_length=50)
purpose = models.CharField(max_length=20)
remark = models.CharField(max_length=10)
def __str__(self):
return self.dname
Since you only want to create a Doc instance if all fields are provided, it should just be a case of checking that something is set for all fields. Since you might not have data for both Doc instances, you wouldn't need to bulk create.
For example:
def fixed_doclist(request):
print("Form is submitted successfully!")
doc_args = {
dname: request.POST.get("dname", False),
exp: request.POST.get("exp", False),
renewdt: request.POST.get("renewdt", False),
purpose: request.POST.get("purpose", False),
remark: request.POST.get("remark", False)
}
doc1_args = {
dname: request.POST.get("dname1", False),
exp: request.POST.get("exp1", False),
renewdt: request.POST.get("renewdt1", False),
purpose: request.POST.get("purpose1", False),
remark: request.POST.get("remark1", False)
}
if all(doc_args.values()):
Doc.objects.create(**doc_args)
if all(doc1_args.values()):
Doc.objects.create(**doc1_args)
return render(request,'fixeddoclist.html')

In line view of forms in modal

I am using Bootstrap modal.
The following is my code.
<!-- Modal -->
<div class="modal fade" id="editModal" role="dialog">
<div class="modal-dialog">
<!-- Modal content-->
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal">×</button>
<h4>Edit Equifax Credit Score Data</h4>
</div>
<div class="modal-body form-horizontal">
<div class="form-group row">
<label for="name" class="col-sm-2 col-form-label">Name</label>
<div class="col-sm-10">
<input type="text" class="form-control" id="equiFaxName"
placeholder="Name" readonly="readonly" />
</div>
</div>
<div class="form-group row">
<label for="startRangeModal" class="col-sm-2 col-form-label">Start
Range</label>
<div class="col-sm-10">
<input type="text" class="form-control" id="startRangeModal"
placeholder="Start Range" />
</div>
</div>
<div class="form-group row">
<label for="endRangeModal" class="col-sm-2 col-form-label">End
Range</label>
<div class="col-sm-10">
<input type="text" class="form-control" id="endRangeModal"
placeholder="End Range" />
</div>
</div>
<div class="form-group row required">
<label for="riskGradeModal" class="col-sm-2 col-form-label">Risk
Grade </label>
<div class="col-sm-10">
<input type="text" class="form-control" id="riskGradeModal"
placeholder="Risk Range" />
</div>
</div>
<div class="form-group row required">
<label for="agentRiskGradeModal" class="col-sm-2 col-form-label">Agent
Display Grade</label>
<div class="col-sm-10">
<input type="text" class="form-control" id="agentRiskGradeModal"
placeholder="Agent Display Grade" />
</div>
</div>
<div class="form-group row required">
<label for="hitCode" class="col-sm-2 col-form-label"> Hit
Code</label>
<div class="col-sm-10">
<input type="text" class="form-control" id="hitCodeModal"
placeholder="Hit Code" />
</div>
</div>
<div class="form-group row required">
<label for="hitCodeResponse" class="col-sm-2 col-form-label">
Hit Code</label>
<div class="col-sm-10">
<input type="text" class="form-control" id="hitCodeResponseModal"
placeholder="Hit Code Response" />
</div>
</div>
<div class="form-group row required">
<label for="approvalTypeListModal" class="col-sm-2 col-form-label">Approval
Type</label> <select id="approvalTypeListModal" class="form-control">
</select>
</div>
</div>
<div class="modal-footer">
<button class="btn btn-primary"
data-dismiss="modal">Cancel</button>
<button class="btn btn-success"
id="submitEditModalData">Save</button>
</div>
</div>
</div>
</div>
In the modal all the form inputs are inline horizontal but the select tag shows below the label and is not inline with the label.
Can someone help me in putting the select box in line and not below the label.
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous">
<div class="form-group row required">
<label for="approvalTypeListModal" class="col-md-2 col-sm-2 col-xs-2 col-form-label">Approval
Type
</label>
<div class="col-md-10 col-sm-10 col-xs-10">
<select id="approvalTypeListModal" class="form-control">
<option value="option1">Option1</option>
</select>
</div>
</div>
You forgot to put class col-md-* .
You can put it in select tag or can make a new div and give it to that class.
Hope this helps.

How to put label and input box on the same line using bootstrap?

I've searched extensively on this site and tried my best, but cannot figure out how to put the label and input on the same line, right now, it displays like this:label and input box are on different lines
First, as people suggested, I grouped them using "form-group" class, but no luck. Then I continued to search, some says you should use "col-sm-1" which I tried, no luck, some says you should use "form-control-static", but still no luck. Any help is deeply appreciated!
<div class="tab-content">
<div class="row" id="create_new_spa_form">
<form method= "post" action ="/purchasing/item_info_new_spa/" onsubmit="javascript: return validate();">
<div class="span4">
<div class="form-group">
<label class="control-label col-sm-1" for="input01">Text input</label>
<div class="controls col-sm-1">
<input type="text" class="form-control-static" id="input01">
</div>
</div>
</div>
<div class="span4">
<div class="form-group">
<label class="control-label" for="input01">Text input</label>
<div class="controls">
<input type="text" class="input-xlarge" id="input01">
</div>
</div>
</div>
<div class="span4">
<div class="form-group">
<label class="control-label" for="input01">Text input</label>
<div class="controls">
<input type="text" class="input-xlarge" id="input01">
</div>
</div>
</div>
</form>
</div>
</div>
After making edits as ZimSystem suggested, now it looks like this:part of first label got truncated
How can I fix this? Also, how can I adjust the size of the input box? I don't need them to be so wide.
Use form-inline and remove the extra markup around the labels and inputs..
<form method="post" action="" class="form-inline">
<label for="input01">Text input</label>
<input type="text" class="form-control-static" id="input01">
<label class="control-label" for="input01">Text input</label>
<input type="text" class="input-xlarge" id="input01">
<label class="control-label" for="input01">Text input</label>
<input type="text" class="input-xlarge" id="input01">
</form>
http://www.bootply.com/7BrrI0uZiH
From the 2.x docs: http://getbootstrap.com/2.3.2/base-css.html#forms
add this to your form
class="form-inline"
more examples here about the Inline form... http://getbootstrap.com/css/#forms
hope this helps :)