Today I am working with Full calendar, I made a small modal window so that when I clicked on an event, it showed me its different data, here is my JavaScript code for the calendar:
$(document).ready(function () {
$('#calendar').fullCalendar({
header: {
left: 'prev,next today',
center: 'title',
right: 'month,agendaWeek,agendaDay'
},
// defaultDate: '2017-09-12',
navLinks: true, // can click day/week names to navigate views
editable: true,
eventLimit: true, // allow "more" link when too many events
selectable: true,
events: {
url: 'data',
error: function () {
console.log("error")
}
},
eventClick: function (event, jsEvent, view) {
//alert("nombre del evento" + event.start.format("YYYY-MM-DD HH:MM:SS") );
//$('#myModalLabel').html(event.title);
$('#ModalTitle').html(event.title);
$('#start').html(event.start.format("YYYY-DD-MM h\ hh:mm:ss") );
$('#Modalevent').modal('show');
},
});
});
With this I get the following calendar:
When I press an event I get the following:
Well, now my problem is that, I want to get the DATE within a input
and not in a label
, but when I place it and do exactly the same as with the label
, it does not show me the date , show me this:
And I want to get it in an input, since I work with python and send that data through the request method to python, I attach an example of another modal window that I already made:
@app.route('/send', methods=['GET','POST'])
def send():
if request.method == 'POST':
bay= request.form['Bay']
rack= request.form['Rack']
status= request.form['Status']
user= request.form['User']
comment= request.form['Comment']
hostname= request.form['Hostname']
hostname = str(hostname)
but for this, I need to have the data in the input, does anyone know how I can make it appear in the input correctly? or because it does not appear to me. I attach the html code:
SAMPLE WITH LABEL:
<div class="modal fade" id="Modalevent">
<div class="modal-dialog modal-sm" role="document">
<div class="modal-content">
<div class="modal-header bg-inverse">
<h3 class="modal-title text-center" id="ModalTitle">
</h3>
</div>
<div class="modal-body">
<div class="form-group">
<h3 class="text-center"> DATE</h3>
**<h4 class="text-center" id="start" name="date"> DATE: </h1>**
<br>
<h3 class="text-center"> CATEGORY</h3>
<select class="form-control" name="category">
<option>Work</option>
<option>Schedule_Downtime</option>
<option>Non_Schedule_Downtime</option>
<option>Overtime</option>
</select>
</div>
</div>
<div class="modal-footer ">
<button type="button" class="btn btn-primary">Save changes</button>
<button type="button" class="btn btn-secondary" data-dismiss="modal">Close</button>
</div>
</div>
</div>
</div>
SAMPLE WITH INPUT:
<!-- Ventana modal -->
<div class="modal fade" id="Modalevent">
<div class="modal-dialog modal-sm" role="document">
<div class="modal-content">
<div class="modal-header bg-inverse">
<h3 class="modal-title text-center" id="ModalTitle">
</h3>
</div>
<div class="modal-body">
<div class="form-group">
<h3 class="text-center"> DATE</h3>
**<input class="form-control" name"start">**
<br>
<h3 class="text-center"> CATEGORY</h3>
<select class="form-control" name="category">
<option>Work</option>
<option>Schedule_Downtime</option>
<option>Non_Schedule_Downtime</option>
<option>Overtime</option>
</select>
</div>
</div>
<div class="modal-footer ">
<button type="button" class="btn btn-primary">Save changes</button>
<button type="button" class="btn btn-secondary" data-dismiss="modal">Close</button>
</div>
</div>
</div>
</div>