Posts

Showing posts from October, 2015

Change Input Value based on different input in jquery

Image
Download Code Here

Bootstrap Collapse on Small screen Size in Mobile

Image
Desktop View   Mobile View Download Here

Jquery Bootstrap Calender to disable previos date and only show upcomming dates

Image
// implementation of disabled form fields var nowTemp = new Date(); var now = new Date(nowTemp.getFullYear(), nowTemp.getMonth(), nowTemp.getDate(), 0, 0, 0, 0); var checkin = $('#dpd1').fdatepicker({ onRender: function (date) { return date.valueOf() < now.valueOf() ? 'disabled' : ''; } }).on('changeDate', function (ev) { if (ev.date.valueOf() > checkout.date.valueOf()) { var newDate = new Date(ev.date) newDate.setDate(newDate.getDate() + 1); checkout.update(newDate); } checkin.hide(); $('#dpd2')[0].focus(); }).data('datepicker'); var checkout = $('#dpd2').fdatepicker({ onRender: function (date) { return date.valueOf() <= checkin.date.valueOf() ? 'disabled' : ''; } }).on('changeDate', function (ev) { checkout.hide(); }).data('datepicker');   Download here   Minimal setup Include dependancies and call the datepicker via javascript: $ ( '.fdatepic

Alert on button click using javascript

<!DOCTYPE html> <html> <body> <p>Click the button to display an alert box:</p> <button onclick="myFunction()">Try it</button> <script> function myFunction() {     alert("I am an alert box!"); } </script> </body> </html>