I have a form with a secondary address section. In this section you can fill in either Street or PO box address. I want to ensure that only one address is submitted so I want to clear the other form if a user enters data into the other input field.
My code below is not working, any ideas? Thanks
$('#pobox_number').change(function() {
if ($(this).val().length > 0) {
$('#street_name_postal').val('');
}
The answer ended up being very simple, not sure why I needed to target the elements so precisely but adding input before “#street_name_postal” did the trick.