I need to be able to autopopulate a text field with "one-hidden" when a customer checks a checkbox, but so far examples I've found online do not seem to work, or I'm putting them in the wrong place.
$('#flight-include').change(function(){
$("#one-control").text("");
if ($('#flight-include').is(':checked')) {
$("#one-control").text("one-hidden");
}
});
I put the above in the function file, and it did nothing, so guessing I'm doing something wrong or missing something.
Flight-control is the checkbox, one-control is the text field. "one-hidden" is the text that needs to appear in the text field when the flight-include box is checked.
Can someone help, as I'm pretty clueless with this type of coding. Many thanks
Tried executing the code above in the function file, but possible not the right place.