The Landing Page.

Go from design to site with Framer, the web builder for creative pros.

Get Started

Logo

Logo

Logo

Logo

<!DOCTYPE html>
<html lang="pt">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Formulário com Seleção de Setor</title>
    <style>
        body {
            font-family: Arial, sans-serif;
            margin: 40px;
        }
        form {
            max-width: 400px;
            padding: 20px;
            border: 1px solid #ccc;
            border-radius: 8px;
            box-shadow: 2px 2px 10px rgba(0, 0, 0, 0.1);
        }
        label {
            font-weight: bold;
        }
        input, select, textarea {
            width: 100%;
            margin-bottom: 10px;
            padding: 8px;
            border: 1px solid #ccc;
            border-radius: 5px;
        }
        button {
            background-color: #28a745;
            color: white;
            padding: 10px;
            border: none;
            border-radius: 5px;
            cursor: pointer;
        }
        button:hover {
            background-color: #218838;
        }
    </style>
</head>
<body>

    <h2>Formulário de Contato</h2>
    <form id="contatoForm" method="post">
        <label for="nome">Nome:</label>
        <input type="text" id="nome" name="nome" required>

        <label for="email">E-mail:</label>
        <input type="email" id="email" name="email" required>

        <label for="mensagem">Mensagem:</label>
        <textarea id="mensagem" name="mensagem" rows="4" required></textarea>

        <label for="setor">Setor:</label>
        <select id="setor" name="setor" required>
            <option value="">-- Selecione um setor --</option>
            <option value="suporte">Suporte</option>
            <option value="vendas">Vendas</option>
            <option value="financeiro">Financeiro</option>
        </select>

        <!-- Campo oculto para armazenar o e-mail do setor -->
        <input type="hidden" id="emailSetor" name="emailSetor">

        <button type="submit">Enviar</button>
    </form>

    <script>
        document.getElementById("setor").addEventListener("change", function() {
            // Mapeamento de setores para e-mails
            const emailsSetor = {
                "suporte": "suporte@empresa.com",
                "vendas": "vendas@empresa.com",
                "financeiro": "financeiro@empresa.com"
            };

            // Pegar o valor selecionado
            let setorSelecionado = this.value;

            // Atualizar o campo oculto com o e-mail correspondente
            document.getElementById("emailSetor").value = emailsSetor[setorSelecionado] || "";
        });

        document.getElementById("contatoForm").addEventListener("submit", function(event) {
            event.preventDefault(); // Evita o envio real do formulário
            
            // Captura os dados do formulário
            let dados = {
                nome: document.getElementById("nome").value,
                email: document.getElementById("email").value,
                mensagem: document.getElementById("mensagem").value,
                setor: document.getElementById("setor").value,
                emailSetor: document.getElementById("emailSetor").value
            };

            // Exibir no console (simulando envio de dados)
            console.log("Dados do Formulário:", dados);
            alert("Formulário enviado para: " + dados.emailSetor);
        });
    </script>

</body>
</html>

FAQ

What is Framer?

Framer is a web builder for creative pros. Be sure to check out framer.com to learn more.

Is it easy to learn?

Framer is the fastest tool to build sites with, because you can ship your design immediately, instead of having to rebuild your design in code or a second tool.

Do I need to code?

Framer is an end to end tool that lets everyone design and ship web sites. You don’t need a frontend team or web programming course. Just basic canvas skills.

Sign up today.

© Framer Inc. 2023

Instagram

Email