Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

179
Views
How can I get selected text from HTML select to send it to a database

I have this select, values are in coming from a database

<select id="construido" name="construido" class="form-select form-select-sm" aria-label=".form-select-sm example">
                        <option id="construido-0" selected class="form-control"></option>
                        <option id="construido-1" value="1"> </option>
                        <option id="construido-2" value="2"> </option>
                    </select>

But now I am trying to get the selected text to send it to another table using ajax php. I tried this but i can access construidoSelected only inside the function

$(document).on('change', '#construido', function () {
    let construidoSelected = $("#construido option:selected").text()
});

let start = 0, url = "http://localhost:8077/connectpost/validations/sendinterview.php";
$(document).ready(function () {

    $('#form_interview').submit(function (e) {
        $.post(url, {
            fuente:"",
            construido:"",
            recibir: $("#recibir-agua").val(),
            horas: $("#horas-agua").val(),

        });
        $("#recibir").val("");
        $("#horas").val("");
        return false;
    })
});

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!