Click here to Skip to main content
15,884,986 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
what i want to do, after i input my data in a form with a dropdown

and then if i click a checkbox, it pass my value from my previous form to another form

What I have tried:

this is what i have tried

$('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('');
       }
   });


code above only return the value in type=text input tag, not the select tag
Posted

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900