Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!DOCTYPE html>
- <html lang="en">
- <head>
- <meta charset="UTF-8">
- <meta name="viewport" content="width=device-width, initial-scale=1.0">
- <title>Input com Range Slider - Bootstrap 4</title>
- <!-- Bootstrap 4 CSS -->
- <link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css">
- <style>
- .slider-labels {
- display: flex;
- justify-content: space-between;
- margin-top: 0px;
- }
- .slider-container {
- margin-top: 20px;
- }
- </style>
- </head>
- <body>
- <div class="container mt-5">
- <div class="row justify-content-center">
- <div class="col-md-6">
- <div class="form-group">
- <button id="voltar" name="voltar" class="btn btn-primary" type="button" onclick="portletHome()">Voltar</button>
- </div>
- <div class="form-group">
- <div style='display: none;' id="radioDivSegmento" class="col-md-6">
- <input type="radio" id="imoveis" name="segmento" value="IMOVEIS" checked>
- </div>
- </div>
- <div class="form-group">
- <div id="radioDiv">
- <input type="radio" id="credito" name="tipo" value="CREDITO" checked>
- <label for="credito">Valor do crédito</label>
- <input type="radio" id="parcela" name="tipo" value="PARCELA">
- <label for="parcela">Valor da parcela</label>
- </div>
- </div>
- <!-- Campo de input para mostrar o valor -->
- <div class="form-group">
- <label for="valorBem">Selecione o Valor</label>
- <input type="number" class="form-control" id="valorBem" min="0" max="600000" step="100" value="300000">
- </div>
- <!-- Range Slider logo abaixo do input -->
- <div class="slider-container">
- <input type="range" class="custom-range" id="slider" min="0" max="600000" step="100" value="300000">
- </div>
- <!-- Rótulos de mínimo e máximo para o slider -->
- <div class="slider-labels">
- <span id="min-label">R$ 0</span>
- <span id="max-label">R$ 600.000</span>
- </div>
- <div class="form-group">
- <button type="submit" id="verOpcoes" name="verOpcoes" class="btn btn-primary">Ver opções</button>
- </div>
- <div id="divMensagens">
- <div id="mensagem-erro" class="alert alert-danger">
- <svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
- <path d="M12 20C16.4187 20 20 16.4187 20 12C20 7.58125 16.4187 4 12 4C7.58125 4 4 7.58125 4 12C4 16.4187 7.58125 20 12 20ZM12 8C12.4156 8 12.75 8.33437 12.75 8.75V12.25C12.75 12.6656 12.4156 13 12 13C11.5844 13 11.25 12.6656 11.25 12.25V8.75C11.25 8.33437 11.5844 8 12 8ZM13 15C13 15.5531 12.5531 16 12 16C11.4469 16 11 15.5531 11 15C11 14.4469 11.4469 14 12 14C12.5531 14 13 14.4469 13 15Z" fill="#DA1414"></path>
- </svg>
- <span class="message"><strong>Ocorreu um erro ao realizar a Simulação.</span>
- </div>
- </div>
- </div>
- </div>
- </div>
- <!-- jQuery e Bootstrap 4 JS -->
- <script src="https://code.jquery.com/jquery-3.6.0.min.js"></script>
- <script src="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/js/bootstrap.bundle.min.js"></script>
- <script>
- $(document).ready(function() {
- // Atualizar o valor do input conforme o slider muda
- $('#slider').on('input', function() {
- $('#valorBem').val($(this).val());
- });
- // Atualizar o slider conforme o input muda
- $('#valorBem').on('input', function() {
- $('#slider').val($(this).val());
- });
- });
- </script>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement