I have a min date taken dynamically. I get the value from my controller as 'setmax'.
I need to give this value to my datepicker mindate.
I ahev tried this by setting
$scope.minDate = $scope.setmax;
inside my controller. But it is not taking this value.
Is it possible to give like this
<input type="text" class="form-control"
datepicker-popup="dd/MM/yyyy"
ng-model="myModel.vdate"
placeholder="Amount valid date"
is-open="startOpened"
ng-init="startOpened = false"
min-date="{{secmax}}"
max-date="end"
required
close-text="Close"
ng-click="startOpen($event)"
name="datevalidity"/>
Did you try this?
<input type="text" class="form-control"
datepicker-popup="dd/MM/yyyy"
ng-model="myModel.vdate"
placeholder="Amount valid date"
is-open="startOpened"
ng-init="startOpened = false"
min-date="setmax"
max-date="end"
required
close-text="Close"
ng-click="startOpen($event)"
name="datevalidity"/>
Related
I'm trying to collect 2 dates using input boxes ids From and To. I would like to subtract 1 day from the date value received using "FROM" text box and pass that new value to the button click event.
The code below works to push values received from the input box. However, i wish to subtract 1 day and pass on the same.
<script src="https://code.jquery.com/jquery-3.4.1.min.js" type="text/javascript"></script>
From : <input type="date" class="form-control" id="From" placeholder="From" aria-label="From">
To : <input type="date" class="form-control" id="To" placeholder="To" aria-label="To">
<input type="button" onclick="location.href='#SITE#/TDL-Test-code.aspx?FromTo=(Date ge datetime%27'+FD+'T00:00:00.000Z%27) and (Date le datetime%27'+ document.getElementById('To').value+'T23:59:00.000Z%27)';" value="Submit" />
Edit:
Following is my moment JS function
var oldfrom = document.getElementById('From').value;
newdate = moment(oldfrom).subtract(1, 'days').format("YYYY-MM-DD");
var FD = newdate;
Issue was fixed with solution below.
document.getElementById("From_Local").oninput = function() {
var dateLocal = document.getElementById("From_Local").value;
var dateUTC = moment.utc(dateLocal).subtract(4, 'hours').format("YYYY-MM-DD");
document.getElementById("From_UTC").value = dateUTC;
}
From:<input name="From" required type="date" id="From_Local">
<input type="hidden" id="From_UTC">
To:<input name="To" required type="date" id="To">
<input type="button" onclick="location.href='SITE_URL?FromTo=(Date%20ge%20datetime%27'+ document.getElementById('From_UTC').value+'T00:00:00.000Z%27)%20and%20(Date%20le%20datetime%27'+ document.getElementById('To').value+'T00:00:00.000Z%27)';" value="Submit" />
I'm trying to add validation for an input field with vue-form-wizard.
It needs to be a min and max length of 6.
<input
type="text"
class="form-control"
:class="hasError('vcode') ? 'is-invalid' : ''"
placeholder="Enter your 6 digit code"
minlength="6"
maxlength="6"
v-model="formData.vcode"
/>
The validation isn't working for this. What am I doing wrong?
I am the very beginner for html and js.
I have a js which can set the value of id="tk___kiaVlink" by using the following.
this.form.formElements.get('tk___kiaVlink').update('abcedf ghi');
But both label and link values are updated. How could I specify js code to update only [link] value?
<div class="fabrikSubElementContainer" id="tk___kiaVlink">
<input type="text" name="tk___kiaVlink[label]" size="200" maxlength="200" class="form-control fabrikinput inputbox fabrikSubElement" placeholder="Label" value="Video">
<input type="text" name="tk___kiaVlink[link]" size="200" maxlength="200" class="form-control fabrikinput inputbox fabrikSubElement" placeholder="URL" value="test value">
I tried using the name tk___kiaVlink[label] and it doesn't work.
const [label, link] = [...document.querySelectorAll('#tk___kiaVlink input')];
[label.value, link.value] = ['my label value', 'my link value'];
I have a DateRangePicker as follows:
HTTP:
<input id="date" name="date" ng-model="FilesDate" class="form-control"/>
JQuery:
$('input[name="date"]').daterangepicker({
opens: 'left'
});
The DateRangePicker works totally fine but when the program initializes, its empty by default. If I remove ng-model, the date initializes properly.
Just set the value of your input:
<input value="01/01/2018 - 01/15/2018" id="date" name="date" ng-model="FilesDate" class="form-control" />
http://www.daterangepicker.com/#examples
$('input[name="date"]').attr('value', '01/01/2018 - 01/15/2018');
I have one input date, this input append from js like this
var inputdate = '<input type="text" name="date[]" class="form-control date" placeholder="Input date"';
$("form").append(inputdate);
And the html code is like this :
<form method="POST">
...
</form>
Initialize datetimepicker
$('.date').datetimepicker({
format: 'YYYY-MM-DD'
});
The input element append succesfully and the other form that have input date work with datetimepicker.
But the element that append from js is not showing datetimepicker, is there any mistakes?
I think you missed one thing here.
var inputdate = '<input type="text" name="date[]" class="form-control date" placeholder="Input date"';
It should have > at the end of string.
The initialization code should be Reexecuted after we append inputDate into $('form').
So the code should be:
var inputdate = '<input type="text" name="date[]" class="form-control date" placeholder="Input date">';
$("form").append(inputdate);
$('.date').datetimepicker({format: 'YYYY-MM-DD'});