Topic: Display form data
Neil Jobbins pro asked 6 years ago
Piotr Glejzer staff answered 6 years ago
Hi,
did you use our label documentation? Here is a link:
Click me
I wish it will help you. If you have any question or It not resolve your problem don't hesitate to ask again. I will try to help you!
Best,
Piotr
Neil Jobbins pro answered 6 years ago
<!-- Material input --> <div class="md-form"> <input type="text" id="firstName" class="form-control"> <label for="firstName" class="form-control-label">First name</label> </div>Now I would like to display this data using similar styling. Perhaps something like:
<div class="md-output-form"> <div class="md-output-textfield">John Doe <div class="md-output-label'>First Name </div>Is there a way to do this easily? Should I create this as a custom style? Am I breaking material design guidelines? Thanks in advance
Piotr Glejzer staff answered 6 years ago
<body>
<div class="md-form">
<input type="text" id="firstName" class="form-control">
<label for="firstName" class="form-control-label"> Name </label>
</div>
<div class="md-form">
<input type="text" id="first-name-display" class="form-control">
<label id="first-name-label" for="first-name-display" class="form-control-label">Name </label>
</div>
<!-- SCRIPTS -->
<!-- JQuery -->
<script type="text/javascript" src="js/jquery-3.3.1.min.js"></script>
<!-- Bootstrap tooltips -->
<script type="text/javascript" src="js/popper.min.js"></script>
<!-- Bootstrap core JavaScript -->
<script type="text/javascript" src="js/bootstrap.min.js"></script>
<!-- MDB core JavaScript -->
<script type="text/javascript" src="js/mdb.min.js"></script>
<script>
//Add active class to label (can be add in HTML)
$('#first-name-label').addClass('active');
//Add disabled to input (also can be add in HTML)
$('#first-name-display').prop('disabled', true);
// If put name in first input it will be display in another
$('#firstName').change(function () {
$('#first-name-display').val($(this).val());
});
</script>
</body>
Best,
Piotr Neil Jobbins pro answered 6 years ago
Piotr Glejzer staff answered 6 years ago
FREE CONSULTATION
Hire our experts to build a dedicated project. We'll analyze your business requirements, for free.
Answered
- User: Pro
- Premium support: No
- Technology: MDB jQuery
- MDB Version: -
- Device: -
- Browser: -
- OS: -
- Provided sample code: No
- Provided link: No