SOLVED

Use query parameter to automatically select a checkboxes choice?

Go to solution
Sheila-SEMI
Level 3

Use query parameter to automatically select a checkboxes choice?

We have a form with a "interests" field that is being shown as checkboxes. We'd like to be able to use a link to the page with a query parameter that would automatically check one of the boxes on the form based on the value of the query parameter. This would happen when the page/form is first displayed.

 

Here's the page with the "interests" field: https://discover.semi.org/technology-communities-subscription-registration.html

Usage example would be, if there is an email talking about cyber security (or a web page)  then there could be a link to the above subscription page and the "cyber security" checkbox would automatically be checked. 

 

Is there a way to do this with Javascript? Any help is appreciated!

Thanks,

Sheila

1 ACCEPTED SOLUTION

Accepted Solutions
SanfordWhiteman
Level 10 - Community Moderator

Re: Use query parameter to automatically select a checkboxes choice?

You can use the all-purpose auto-fill code at

 

MktoForms2 :: KV HTML w/Auto-Fill and Cascade v1.1.2

 

Download the FormsPlus::Util JS and upload it to your Design Studio and then include it as shown in the HTML pane.

 

Then after FormsPlus::Util, include the local <script> as shown in the JS pane.

 

Your config block would be like

 

 

var fieldFillRules = [      
  {
    name : "Interest_Tech_Community__c",
    channel: "query",
    selector: "interest"
  }
];

 

 

 

View solution in original post

3 REPLIES 3
SanfordWhiteman
Level 10 - Community Moderator

Re: Use query parameter to automatically select a checkboxes choice?

You can use the all-purpose auto-fill code at

 

MktoForms2 :: KV HTML w/Auto-Fill and Cascade v1.1.2

 

Download the FormsPlus::Util JS and upload it to your Design Studio and then include it as shown in the HTML pane.

 

Then after FormsPlus::Util, include the local <script> as shown in the JS pane.

 

Your config block would be like

 

 

var fieldFillRules = [      
  {
    name : "Interest_Tech_Community__c",
    channel: "query",
    selector: "interest"
  }
];

 

 

 

Sheila-SEMI
Level 3

Re: Use query parameter to automatically select a checkboxes choice?

@SanfordWhiteman Thank you!

Sheila-SEMI
Level 3

Re: Use query parameter to automatically select a checkboxes choice?

@SanfordWhiteman I'm so sorry for the delay in fully responding. I finally was able to implement today and all is working like a champ. Thank you for this great code - and for all you do for so many of us in the community! 

Sheila