1
I’m trying to use the Sweet Alert 2.
I would like to increase the textarea field using the Rows attribute, but it is not working.
How do I increase the field size?
$('.btn').on('click', function(){
telaModal()
});
function telaModal(){
swal({
title: 'Dados do acidente',
html:
'<input id="swal-input1" class="swal2-input" placeholder="Data do Acidente">' +
'<textarea id="swal-input2" class="swal2-input" rows="100"></textarea>',
focusConfirm: false,
customClass: 'sweetalert-lg',
onOpen: function() {
$('#swal-input1').datetimepicker({
"format": 'd/m/Y',
"mask":true,
"value": new Date()
});
},
width: '400px',
heightAuto: false,
preConfirm: () => {
return [
document.getElementById('swal-input1').value,
document.getElementById('swal-input2').value
]
}
})
}
<script
src="https://code.jquery.com/jquery-3.3.1.min.js"
integrity="sha256-FgpCb/KJQlLNfOu91ta32o/NMZxltwRo8QtmkMRdAu8="
crossorigin="anonymous"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/limonte-sweetalert2/7.25.0/sweetalert2.all.min.js"></script>
<button class='btn' >Clique</button>
I’d like it to look something like this:
What’s the point of
!important
even?– adventistaam
Basically it is to override the Rules of Precedence. You can see more detailed here What is the purpose of the declaration "!? - @adventist
– codermarcos
Blz! Thank you very much!
– adventistaam