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

169
Views
Pass a value from selected option to another option

what i'm trying to do is to pass a value from selected option that i have choose, to another option tag in another form by clicking a checkbox

from this form

click a checkbox

and then to this form

what i have done is:

$('input[name=sameKTP]').change(function() {
    if($('input[name="sameKTP"]').is(':checked')) {
        $(this).prop('checked',true);
        $('#domcAddressDataSubmit').val($('#ktpAddressDataSubmit').val());
        $('#domcStateId').val($('#ktpStateId').val());
        $('#domcCityId').val($('#ktpCityId').val());
        $('#domcDistrictId').val($('#ktpDistrictId').val());
        $('#domcSubDistrictId').val($('#ktpSubDistrictId ').val());
        $('#domcRtDataSubmit').val($('#ktpRtDataSubmit').val());
        $('#domcRwDataSubmit').val($('#ktpRwDataSubmit').val());
    } else {
        $(this).prop('checked',false);
        $('#domcAddressDataSubmit').val('');
        $('#domcStateId').val('');
        $('#domcCityId').val('');
        $('#domcDistrictId').val('');
        $('#domcSubDistrictId').val('');
        $('#domcRtDataSubmit').val('');
        $('#domcRwDataSubmit').val('');
    }
});

this code could only pass a value that have a type=text field not a value in option tag

How can I do this the best way?

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!