A input Material Card embeded in Material Dialog
A Pen by prashant dawar on CodePen.
<html lang="en"> | |
<head> | |
<meta charset="UTF-8"> | |
<title>Journey Rate Dialog</title> | |
<link rel="stylesheet" href="https://code.getmdl.io/1.2.0/material.indigo-pink.min.css"> | |
<script defer src="https://code.getmdl.io/1.2.0/material.min.js"></script> | |
</head> | |
<body> | |
<button id="show-dialog" type="button" class="mdl-button">Show Dialog</button> | |
<dialog class="mdl-dialog"> | |
<h4 class="mdl-dialog__title">Journey Rate</h4> | |
<div class="mdl-dialog__content"> | |
<div class="mdl-textfield mdl-js-textfield mdl-textfield--floating-label"> | |
<input class="mdl-textfield__input" type="text" id="j-source" pattern="[A-Z,a-z,0-9, ]*"> | |
<label class="mdl-textfield__label" for="j-source">Journey Source</label> | |
<span class="mdl-textfield__error">Letters, numbers and spaces only</span> | |
</div> | |
<div class="mdl-textfield mdl-js-textfield mdl-textfield--floating-label"> | |
<input class="mdl-textfield__input" type="text" id="j-destination" pattern="[A-Z,a-z,0-9, ]*"> | |
<label class="mdl-textfield__label" for="j-destination">Journey Destination</label> | |
<span class="mdl-textfield__error">Letters, numbers and spaces only</span> | |
</div> | |
<div class="mdl-textfield mdl-js-textfield mdl-textfield--floating-label"> | |
<input class="mdl-textfield__input" type="text" id="j-f__ss" pattern="[0-9]*"> | |
<label class="mdl-textfield__label" for="j-f__ss">One Side Fare (INR)</label> | |
<span class="mdl-textfield__error">Numbers only</span> | |
</div> | |
<div class="mdl-textfield mdl-js-textfield mdl-textfield--floating-label"> | |
<input class="mdl-textfield__input" type="text" id="j-f__ds" pattern="[0-9]*"> | |
<label class="mdl-textfield__label" for="j-f__ds">Two Side Fare (INR)</label> | |
<span class="mdl-textfield__error">Numbers only</span> | |
</div> | |
</div> | |
<div class="mdl-dialog__actions"> | |
<button class="mdl-button mdl-js-button mdl-js-ripple-effect mdl-button--colored mdl-shadow--2dp" id="dialog-rate_save">Save</button> | |
<button type="button" class="mdl-button " id="dialog-rate_clear">Clear</button> | |
<button type="button" class="mdl-button close">Close</button> | |
</div> | |
<div id="dialog-rate_progress" class="mdl-progress mdl-js-progress mdl-progress__indeterminate" ></div> | |
</dialog> | |
</body> | |
</body> | |
</html> |
A input Material Card embeded in Material Dialog
A Pen by prashant dawar on CodePen.
var dialog = document.querySelector('dialog'); | |
var showDialogButton = document.querySelector('#show-dialog'); | |
if (! dialog.showModal) { | |
dialogPolyfill.registerDialog(dialog); | |
} | |
showDialogButton.addEventListener('click', function() { | |
dialog.showModal(); | |
}); | |
dialog.querySelector('.close').addEventListener('click', function() { | |
dialog.close(); | |
}); | |
/* Operations Using jQuery */ | |
$(document).ready(function(){ | |
$('#dialog-rate_progress').hide(); | |
}); | |
$('#dialog-rate_save').click(function(){ | |
$('#dialog-rate_progress').show(); | |
}); |