--- title: "Preventing Query String Parameter Bleed-Through in Group Registrations" slug: "preventing-query-string-parameter-bleed-through-in-group-registrations" status: "new" updated: 2026-07-21T20:46:58Z published: 2026-07-21T20:46:58Z canonical: "knowledge.technolutions.net/preventing-query-string-parameter-bleed-through-in-group-registrations" stale: true --- > ## Documentation Index > Fetch the complete documentation index at: https://knowledge.technolutions.net/llms.txt > Use this file to discover all available pages before exploring further. # Preventing Query String Parameter Bleed-Through in Group Registrations When a form uses query string parameters to prefill registrant information, those values can also appear in the hidden template used by a group registration block. If the template keeps those values, each additional registration row can inherit the original registrant's information. You can add custom JavaScript to clear the registration block template after the form loads. New rows added from the template will then start blank, while the first registration can still use the intended prefilled values. > [!WARNING] > 📝 Note > > This approach uses custom JavaScript. Test it thoroughly in a development environment, especially if the form includes default values, payment widgets, conditional logic, or required fields inside the registration block. > [!TIP] > ⭐ Get Inspired > > This article was adapted from [a post by Technolutions staff](https://community.technolutions.net/get-inspired/post/custom-javascript-for-group-registration-blocks-preventing-query-string-vPxjRtHJ9aV04NU) in the Slate Community Forums' Get Inspired space. Have a great idea for a Get Inspired post? [Let us know](https://community.technolutions.net/get-inspired/new?post_type=gnHx7As1gZ8r6Ld)! ## When to use this pattern Use this pattern when all of the following are true: - The form or event uses a registration block for group registration. - The form URL uses query string parameters to prefill values, such as a record GUID or specific form fields. - Additional registration rows should not inherit those prefilled values. ## Add the basic cleanup script 1. Open the form or event. 2. Select **Edit Form**. 3. Select **Edit Scripts / Styles**. 4. Open the **Custom Scripts** tab. 5. Add the following script. ```plaintext $(function() {  function clearTemplate() {    var template = $('tbody.replicate_template');    template.find('input:not([type="hidden"]):not([type="checkbox"]):not([type="radio"])')      .attr('value', '');    template.find('input[type="checkbox"], input[type="radio"]')      .removeAttr('checked');    template.find('select option')      .removeAttr('selected');    template.find('textarea')      .text('');  }  setTimeout(clearTemplate, 50); }); ``` The script waits briefly after the page loads, finds the hidden registration block template, and clears text inputs, checkboxes, radio buttons, select values, and text areas in that template. It does not clear payment amount widgets. ## Keep selected default values The basic script clears default values from the registration block template. If specific fields should keep their default values in each additional registration row, exclude those fields by export key. In the following example, fields with export keys `keepthis` and `keepthis2` are not cleared. ```plaintext $(function() {  function shouldClear(field) {    return $(field).closest('[data-export="keepthis"]').length === 0 &&      $(field).closest('[data-export="keepthis2"]').length === 0;  }  function clearTemplate() {    var template = $('tbody.replicate_template');    template.find('input:not([type="hidden"]):not([type="checkbox"]):not([type="radio"])')      .filter(function() { return shouldClear(this); })      .attr('value', '');    template.find('input[type="checkbox"], input[type="radio"]')      .filter(function() { return shouldClear(this); })      .removeAttr('checked');    template.find('select')      .filter(function() { return shouldClear(this); })      .find('option')      .removeAttr('selected');    template.find('textarea')      .filter(function() { return shouldClear(this); })      .text('');  }  setTimeout(clearTemplate, 50); }); ``` To exclude more fields, add another condition to the `shouldClear` function and replace `export-key` with the field's export key: ```plaintext && $(field).closest('[data-export="export-key"]').length === 0 ``` ## Test the form 1. Open the form using the same query string parameters that will be used in production. 2. Confirm that the intended first registrant values prefill correctly. 3. Select the registration block's insert link to add another registrant. 4. Confirm that the new registrant row starts blank, except for any fields intentionally excluded from the cleanup script. 5. Submit a test registration and confirm that each registrant appears as its own registration row. > [!NOTE] > 💡 Tip > > Keep export keys short, stable, and descriptive. They are easier to target in custom scripts and easier to troubleshoot later. 📖 [Group Registrations](https://knowledge.technolutions.net/docs/group-registrations) 📖 [Prepopulating or Prefilling Forms Using Query String Parameters](https://knowledge.technolutions.net/docs/prepopulating-or-prefilling-forms-using-query-string-parameters) 📖 [Form-Specific CSS (Custom Styles)](https://knowledge.technolutions.net/docs/form-specific-css-custom-styles)