Page with some other inputs which are working correctly...
for example...
<div class="md-form">
<div class="md-form">
<i class="fa fa-pencil prefix"></i>
<textarea type="text" id="description" name="description" class="md-textarea"></textarea>
<label for="trip_description">Description text</label>
</div>
</div>
.
.
.
<div id="add-form">
Some Text</div>
.
.
.
<script type="text/javascript">
$('#add-form-button').click(function (){
$.ajax({
type: 'GET',
url: '/Ajax/Trips/AddForm',
dataType: 'html',
success: function (data) {
var rep = JSON.parse(data);
if (rep.code == 200) {
$('#add-form').html(rep.html);
}
},
error: function (xhr) {
console.log(" An error occured while loading via Ajax: " + xhr.status + " " + xhr.statusText);
}
});
});
</script>
------------------------ The html variable what i send back:
html='
some other html...
<div class="md-form">
<div class="md-form">
<!--<i class="fa fa-tag prefix"></i>-->
<input id="create-region-title" type="text" placeholder="Enter a title for your region">
<label for="create-region-title">Name for your region</label>
</div>
</div>
<div class="col-md-6">
<div class="md-form">
<i class="fa fa-calendar-o prefix"></i>
<input placeholder="Selected date" type="text" id="start_date" name="start_date" class="form-control date-picker">
<label for="start_date">Choose a start date...</label>
</div>
</div>
some other html...
<script type="text/javascript">
$('.date-picker').pickadate();
</script>
';
I have now a simmilar problem also with an datepicker...
the datepicker is not shown up right until the first opening of it...
The error shown in the console: TypeError: $(...).pickadate is not a function[Weitere Informationen]