Hi there,
First, I know that Klaviyo team themselves do not support troubleshooting custom preferences pages, but I hope someone in the community can help.
I have a custom preferences page where, if someone unselects a property, it doesn’t remove it from their profile.
Here’s my code:
<input type="hidden" name="$fields" value="EmailInterests,EmailFrequency,is_b2b,is_personal" />
<input type="hidden" name="$list_fields" value="EmailInterests" />
and
<div class="form-group">
<label for="purpose" class="col-sm-3 control-label">I am buying for:</label>
<div class="col-sm-9">
<div class="checkbox">
<label>
<input type="checkbox" name="is_b2b" value="true" {% if person.is_b2b == 'true' or request.POST.is_b2b == 'true' or person.is_b2b == 1 or request.POST.is_b2b == 1 %}checked="checked"{% elif not person.is_b2b and not request.POST.is_b2b %}{% endif %} />
Business
</label>
</div>
</div>
</div>
<div class="form-group">
<label for="interests" class="col-sm-3 control-label">Interests</label>
<div class="col-sm-9">
<div class="checkbox">
<label>
<input type="checkbox" name="EmailInterests" value="New Releases" {% if 'New Releases' in person.EmailInterests or 'New Releases' in request.POST.EmailInterests %}checked="checked"{% elif not person.EmailInterests and not request.POST.EmailInterests %}{% endif %} />
New Product Releases
</label>
</div>
<div class="checkbox">
<label>
<input type="checkbox" name="EmailInterests" value="Promotions" {% if 'Promotions' in person.EmailInterests or 'Promotions' in request.POST.EmailInterests %}checked="checked"{% elif not person.EmailInterests and not request.POST.EmailInterests %}{% endif %} />
Promotions & Sales
</label>
</div>
<div class="checkbox">
<label>
<input type="checkbox" name="EmailInterests" value="Blog" {% if 'Blog' in person.EmailInterests or 'Blog' in request.POST.EmailInterests %}{% elif not person.EmailInterests and not request.POST.EmailInterests %}{% endif %} />
Latest from the Blog
</label>
</div>
<div class="checkbox">
<label>
<input type="checkbox" name="EmailInterests" value="Events" {% if 'Events' in person.EmailInterests or 'Events' in request.POST.EmailInterests %}{% elif not person.EmailInterests and not request.POST.EmailInterests %}{% endif %} />
Events
</label>
</div>
</div>
</div>
The challenge is that even if someone unchecks and saves, it still doesn’t update the field.