Q-select selected value and select dropdown in Vuejs3 is not displayed correctly - select

I make an application in vuejs3 and quasar, here i am using q-select but selected option and select arrow is not welle displayed here the display
i have no specific CSS, here my component
<template>
<teleport v-if="show" to="#modals">
<div class="modal" tabindex="-1" role="dialog" style="overflow-y: scroll">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title">Changer le status de la commande N° {{ orderId }}</h5>
</div>
<form class="status-form" #submit.prevent="onSubmit">
<div class="modal-body">
<Comment :id_order="orderId" />
<!-- <select id="state" v-model="selected">
<option
v-for="state in orderStates"
:value="state.id"
:key="state.id"
>
{{ state.name }}
</option>
</select> -->
<q-select outlined v-model="state" name="state" :options="orderStates" label="state.name" option-value="id"
option-label="name" fill-input use-input/>
</div>
<div class="modal-footer">
<button type="submit" class="btn btn-primary">
<slot name="loading" v-if="loadingState">Loading...</slot>
<slot name="loading" v-if="!loadingState"
>Changer le status</slot
>
</button>
<button
type="button"
class="btn btn-secondary"
#click="
$emit('update:show', !show),
$emit('update:orderDetails', []),
$emit('update:orderId', null),
$emit('update:selected', null)
"
>
Fermer
</button>
</div>
</form>
</div>
</div>
</div>
any idea ?

Related

stop reloading the entire page after Modal from submission in razor pages

I have a edit page like this
i have a comment button in this page,which is a modal form ,where users can leave their comment
when i submit the Comment form,the entire page is reloading and im losing the edit page content.
Im handling edit page content and comment box in two different forms.
So when i submit the comment form,the modal should open as it is and also the edit page content should not be gone.
This is my modal
<div class="modal modal_outer right_modal fade" id="information_modal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel2">
<div class="modal-dialog" role="document">
<div class="modal-content ">
<div class="modal-header bg-warning" style="height:50px;padding:10px 5px;font-family:'Delivery';">
<h4 class="modal-title">Comments:</h4>
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">×</span>
</button>
</div>
<div class="modal-body get_quote_view_modal_body">
<div class="list-group">
<a href="#" class="list-group-item list-group-item-action">
<div class="d-flex w-100">
<h5><i class="fas fa-user"></i> User 1</h5>
<small class="ml-auto">1 days ago</small>
</div>
<p>This is for testing.Please ignore this.</p>
</a>
</div>
<form asp-page-handler="SubmitChat">
<div class="form-group mt-2">
<label for="TxtAreaChatBox"><b>Leave Your Comments</b></label>
<textarea asp-for="RequestChatBox.Comments" class="form-control" id="TxtAreaChatBox" rows="4"></textarea>
<input id="hdnCommentReqID" type="hidden" asp-for="RequestChatBox.RequestID" value='#Request.Query["RequestID"]' />
</div>
<div class="modal-footer">
<button type="reset" class="btn btn-danger" data-dismiss="modal"><i class="fas fa-window-close mr-2"></i> Cancel</button>
<button type="submit" class="btn btn-primary">Submit</button>
</div>
</form>
</div>
</div>
</div>
------------Edited-------------------
<!---COMMENT BOX STARTS HERE-->
<div class="modal modal_outer right_modal fade" id="information_modal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel2">
<div class="modal-dialog" role="document">
<div class="modal-content ">
<div class="modal-header bg-warning" style="height:50px;padding:10px 5px;font-family:'Delivery';">
<h4 class="modal-title">Comments:</h4>
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">×</span>
</button>
</div>
<div class="modal-body get_quote_view_modal_body">
<div class="list-group">
#if (Model.ShowRequestChatBox != null){
#foreach (var item in Model.ShowRequestChatBox)
{
<a href="#" class="list-group-item list-group-item-action">
<div class="d-flex w-100">
<h6><i class="fas fa-user"></i> <i>#Html.DisplayFor(modelItem => item.CommentedUser)</i></h6>
<small class="ml-auto">#Html.DisplayFor(modelItem => item.LastModifiedTimeStamp)</small>
</div>
<p>#Html.DisplayFor(modelItem => item.Comments)</p>
</a>
}
}
</div>
<form asp-page-handler="SubmitChat" data-ajax="true" data-ajax-method="post" data-ajax-complete="Completed">
<div class="form-group mt-2">
<label for="TxtAreaChatBox"><b>Leave Your Comments</b></label>
<textarea asp-for="RequestChatBox.Comments" class="form-control" id="TxtAreaChatBox" rows="4"></textarea>
<input id="hdnCommentReqID" type="hidden" asp-for="RequestChatBox.RequestID" value='#Request.Query["RequestID"]' />
</div>
<div class="modal-footer">
<button type="reset" class="btn btn-danger" data-dismiss="modal"><i class="fas fa-window-close mr-2"></i> Cancel</button>
<button type="submit" id="BtnChatSubmit" class="btn btn-primary">Submit</button>
</div>
</form>
</div>
</div>
</div>
</div>
<!--COMMENT BOX ENDS HERE-->
Javascript
function Completed(event) {
if (event.responseText != "") {
alert("Some Error Has Occured.Please Check Your Entered Values.");
} else {
alert("Your Comment Has Been Added Successfully");
}
}
Thanks,
Teena

Error setting form array only brings first value

I can't find the problem to set value in my form. It's only brings me the first value and the mistake is ERROR Error: Cannot find form control at index 1
at FormArray._throwIfControlMissing. Does anyone know what the right way would be like?
in my components
public setValueForm(): void {
const values = {
'_id': this.priceList._id,
'name': this.priceList.name,
'percentage' : this.priceList.percentage,
'allowSpecialRules' : this.priceList.allowSpecialRules,
'rules' : this.priceList.rules || []
};
this.priceListForm.setValue(values);
}
and my html
<div class="row tab-content">
<div formArrayName="rules" *ngFor="let rule of priceListForm.get('rules').controls; let i = index;">
<div [formGroupName]="i">
<div class="row">
<div class="form-group col-md-4">
<label for="category" class="control-label">Rubro:</label>
<select class="form-control" formControlName="category">
<option *ngFor="let category of categories"
[value]="category._id"
[disabled]="readonly">
{{category.description}}
</option>
</select>
</div>
<div class="form-group col-md-4">
<label for="make" class="control-label">Marca</label>
<select class="form-control" formControlName="make">
<option *ngFor="let make of makes"
[value]="make._id"
[disabled]="readonly">
{{make.description}}</option>
</select>
</div>
<div class="form-group col-md-3">
<label for="percentage" class="control-label">Porcentaje:</label>
<div class="input-group">
<input type="number" class="form-control" formControlName="percentage" name="percentage" id="percentage" [readonly]="readonly"/>
</div>
<div *ngIf="formErrors.percentage" class="alert alert-danger">
{{ formErrors.percentage }}
</div>
</div>
<div class="col-md-1">
<label class="control-label">Acción:</label>
<button type="button" class="btn btn-success btn-sm" (click)="addRule()">
<i class="fa fa-plus"></i>
</button>
<button type="button" class="btn btn-danger btn-sm" (click)="deleteRule(i)">
<i class="fa fa-trash-o"></i>
</button>
</div>
</div>
</div>
</div>
</div>
Resolved
let control = <FormArray>this.priceListForm.controls.rules;
this.priceList.rules.forEach(x => {
control.push(this._fb.group({
'_id': x._id,
'percentage': x.percentage,
'make' : x.make,
'category' : x.category
}))
})

Bootstrap 4 DatePicke issue

I am using bootstrap 4, jQuery 3.3.1 and datepicker (http://www.eyecon.ro/bootstrap-datepicker/)
I have three issues:
The Calendar icon is not the size of the input box
When submit without selecting the date, bootstrap validation message not working.
Auto close is not working.
$(document).ready(function()
{
$('#depositeDate').datepicker({
"setDate": new Date(),
"autoclose": true
});
})
<div class="form-group row">
<label for="depositeDate" class="col-sm-4 col-form-label col-form-label-lg">Deposit Date</label>
<div class="col-sm-2 input-group date">
<input type="text" class=" text-input form-control" id ="depositeDate" placeholder="MM/DD/YYYY">
<div class="input-group-addon">
<i class="fas fa-calendar-alt fa-3x" style="color:RED"></i> </div>
<div class="invalid-feedback">
Please enter a valid Order Number.
</div>
</div>
</div>
The Calendar icon is not the size of the input box
The markup for input group addon is changed in Bootstrap 4.0 stable
<div class="input-group mb-3">
<input type="text" class="form-control" placeholder="Recipient's username" aria-label="Recipient's username" aria-describedby="basic-addon2">
<div class="input-group-append">
<span class="input-group-text" id="basic-addon2">#example.com</span>
</div>
</div>
Your code should be
<div class="input-group date" >
<input type="text" class="form-control" id ="depositeDate" placeholder="MM/DD/YYYY">
<div class="input-group-append">
<span class="input-group-text" id="basic-addon2"><span class="fa fa-calendar"></span></span>
</div>
</div>
3.Auto close is not working.
I don't see setting like "autoclose": true , we should explicitly call to close the datepicker.
.on('changeDate', function(ev) {
checkout.hide();
})
<div class="form-group row justify-content-center align-items-center">
<label for="depositeDate" class="col-sm-3 col-form-label">Deposit Date</label>
<div class="col-sm-3 input-group date" >
<input type="text" class="text-input form-control" id ="depositeDate" placeholder="MM/DD/YYYY">
<div class="input-group-addon" style="cursor: pointer;" onclick="$('#depositeDate').focus();">
<i class="fas fa-calendar-alt fa-2x"></i>
</div>
</div>
</div>
this code will do:
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/1.12.4/jquery.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/moment.js/2.15.1/moment.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.3.7/js/bootstrap.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/bootstrap-datetimepicker/4.7.14/js/bootstrap-datetimepicker.min.js"></script>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.3.7/css/bootstrap.min.css">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/bootstrap-datetimepicker/4.7.14/css/bootstrap-datetimepicker.min.css">
<br>
<div class="container">
<div class="row">
<div class='col-sm-6'>
<div class="form-group">
<label for="Order number">Order number</label>
<input type="text" id="Order number" >
</div>
<div class="form-group">
<div class='input-group date' id='datetimepicker1'>
<label for="male">Deposit Date</label>
<input type='text' class="form-control" />
<span class="input-group-addon">
<span class="glyphicon glyphicon-calendar"></span>
</span>
</div>
</div>
</div>
</div>
</div>
<script>$(function() {
$('#datetimepicker1').datetimepicker();
});</script>
check out the fiddle:https://jsfiddle.net/rqy7L2do/

Bootstrap 3 contact modal is not showing up

I have a small contact modal on my website that does not appear. It was working before, but I must have changed something and now it won't work.
I've looked over it multiple times and I can't figure out why it's not working.
HTML:
<span data-toggle="modal">Contact</span>
<div class="modal fade" id="contact" role="dialog">
<div class="modal-dialog">
<div class="modal-content">
<form class="form-horizontal">
<div class="modal-header">
<h4>Contact the Developers</h4>
</div>
<div class="modal-body">
<div class="form-group">
<label for="contact-name" class="col-lg-2 control-label">Name:</label>
<div class="col-lg-10">
<input type="text" class="form-control" id="contact-name" placeholder="Full Name">
</div>
</div>
<div class="form-group">
<label for="contact-email" class="col-lg-2 control-label">Email:</label>
<div class="col-lg-10">
<input type="email" class="form-control" id="contact-email" placeholder="you#example.com">
</div>
</div>
<div class="form-group">
<label for="contact-msg" class="col-lg-2 control-label">Message:</label>
<div class="col-lg-10">
<textarea class="form-control" rows="8"></textarea>
</div>
</div>
</div>
<div class="modal-footer">
<a class="btn btn-default" data-dismiss="modal">Close</a>
<button class="btn btn-primary" type="submit">Send</button>
</div>
</form>
</div>
</div>
</div>
You are missing the data-target attribute. Plus, you shouldn't be linking to a page when you want to open a modal ;)
<span data-toggle="modal" data-target="#contact">Contact</span>
Should fix this. See http://www.bootply.com/UED0aevXsG

Bootstrap Modal Form Post/GET doesn't send field values

I have a simple modal form :
<div class="modal fade" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
<div class="modal-dialog">
<div class="modal-content modal-lg">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
<h4 class="modal-title" id="myModalLabel">Address Maintenance</h4>
</div>
<div class="modal-body">
<form class="form-horizontal" role="form" id="maintainAddress" method='GET' action="test.php">
<div class="form-group">
<label for="addressID" class="col-sm-2 control-label input-sm">Address ID</label>
<div class="col-sm-4">
<input type="text" class="form-control input-sm" id="addressID" placeholder="Address ID">
</div>
<label for="houseNo" class="col-sm-2 control-label input-sm">House No</label>
<div class="col-sm-4">
<input type="text" class="form-control input-sm" id="houseNo" placeholder="House No">
</div>
</div>
</div>
<div class="modal-footer">
<button type="submit" class="btn btn-default">SAVE</button>
<button type="button" class="btn btn-default" data-dismiss="modal">CANCEL</button>
</div>
</form>
</div><!-- /.modal-content -->
</div><!-- /.modal-dialog -->
</div><!-- /.modal -->
test.php is :
<?
$addressID=$_GET["addressID"];
$houseNo=$_GET["houseNo"];
echo $addressID . " " . $houseNo;
?>
test.php does get invoked on clicking 'SAVE' button but test.php is unable to receive any field values of addressID and houseNo. Error message is "
Notice: Undefined index: addressID in D:\proto\xampp\htdocs\scorecard\test.php on line 3
Notice: Undefined index: houseNo in D:\proto\xampp\htdocs\scorecard\test.php on line 4
I have tried changing GET to POST but still it doesn't work.
The form-elements should have the name-attribute set. So this:
<input type="text" class="form-control input-sm" id="houseNo" placeholder="House No">
Should be changed to:
<input type="text" class="form-control input-sm" id="houseNo" name = "houseNo" placeholder="House No">