Hi there,
I hope this makes sense. I have a form on our website which is below
is there a way to run the same form above but only count the completion as a contact request if the query box is populated at all?
Here are the hidden fields we have:
and for Account Source its B2B Partnership Enquiry so we know someone used the Enquiry form on the website however the other form we have with similar fields are just called 'Brochure Download'
If I was to have Account Source: B2B Partnership Enquiry and Person Source: B2B Partnership Enquiry and then below that Account Source II: Brochure Download and Person Source II: Brochure Download could I then jump in the if statement area and make this happen?
Solved! Go to Solution.
Your phrasing is unclear: what do you mean by "jump in the if statement area"?
If you mean the Visibility Rules list, then no, you can't set a field's value using VRs.
Do you want to only populate a certain field if another field is non-empty, you must use JS.
MktoForms2.whenReady(function(form){
form.onSubmit(function(form){
var currentValues = form.getValues();if (currentValues.someVisibleTextField != "") {
form.addHiddenFields({
isSomeKindOfInterestingRequest : "Yep, it's interesting"
});
}
});
});
Your phrasing is unclear: what do you mean by "jump in the if statement area"?
If you mean the Visibility Rules list, then no, you can't set a field's value using VRs.
Do you want to only populate a certain field if another field is non-empty, you must use JS.
MktoForms2.whenReady(function(form){
form.onSubmit(function(form){
var currentValues = form.getValues();if (currentValues.someVisibleTextField != "") {
form.addHiddenFields({
isSomeKindOfInterestingRequest : "Yep, it's interesting"
});
}
});
});
Hi Sanford,
Thanks for this -