最近搜索
没有最近搜索
Conditional Field Logic Sometimes Not Working With Preset Fields
已于 2023年11月08日 发布
Hi,
I have a field "Partner Name" in the form (https://possibilitylabs.zendesk.com/hc/en-us/requests/new?ticket_form_id=1500003104802) that triggers conditional fields to show based on the value that is entered for "Partner Name". I currently have it such that the value for "Partner Name" is automatically entered based on the person currently logged in, via a Zendesk custom theme file created using Javascript code.
The issue that I'm facing is that sometimes upon page load, the conditional logic isn't firing and the custom fields aren't showing, even thought the "Partner Name" field is being preset correctly.
Below is the code for presetting the "Partner Name" value, and I attached a screenshot of the conditional fields logic.
function customizeVendorPaymentRequestForm(ticketFormId) {
if (ticketFormId==1500000340581) {
setGLCode();
};
setPartnerName();
setRequestorName();
setRequestorJobTitle();
setAttachmentText(isExecutiveDirector?"Please attach the invoice.":"Please attach the invoice.");
changeLabelText(didYouAttachApprovalLabelFieldId, didYouAttachApprovalText);
setTimeout(function () {
changeLabelText(doYouApproveThisRequestLabelFieldId, doYouApproveThisRequestText);
}, 500);
};
function setPartnerName() {
$('#request_custom_fields_1500002896402').val(partnerName);
if (partnerName&&partnerName!=undefined&&partnerName!="")
disableFieldByCss("request_custom_fields_1500002896402");
};
I look forward to your feedback and advice!
Sincerely,
Daniel
2
1 条评论
Contentful Team
I have a similar issue - the conditional field never shows for me when the field is preset, and when I type it manually, they do show. I wonder if you found a solution!
0