SOLVED

What is the code to disable prefill/pre-pop for a single form field?

Go to solution
Anonymous
Not applicable

What is the code to disable prefill/pre-pop for a single form field?

I've worked on projects where there was some javascript that went in the Head section that allowed you to specify a single field on a form that would NOT pre-pop. We found it very useful when people were registering for webinars and wanted to change the date of the registration or register for multiple dates. Now that I'm at a new gig, I can't find this code anywhere in the Community. Help?
Tags (1)
1 ACCEPTED SOLUTION

Accepted Solutions
Jep_Castelein2
Level 10

Re: What is the code to disable prefill/pre-pop for a single form field?

It's the last code sample on this page: https://community.marketo.com/MarketoArticle?id=kA050000000Kyy3

Best, 
Jep

Replace the yellow text with your exact field name

<script type="text/javascript" src="/js/public/jquery-latest.min.js"></script>
<script type="text/javascript">
    // set no conflict mode for jquery
  var $jQ = jQuery.noConflict();

  $jQ(document).ready(function(){
    $jQ('#Comments').attr('value','');
  });
</script>

View solution in original post

5 REPLIES 5
Anonymous
Not applicable

Re: What is the code to disable prefill/pre-pop for a single form field?

We at Bazaarvoice have also been struggling with this. Marketo - please help!
Jep_Castelein2
Level 10

Re: What is the code to disable prefill/pre-pop for a single form field?

It's the last code sample on this page: https://community.marketo.com/MarketoArticle?id=kA050000000Kyy3

Best, 
Jep

Replace the yellow text with your exact field name

<script type="text/javascript" src="/js/public/jquery-latest.min.js"></script>
<script type="text/javascript">
    // set no conflict mode for jquery
  var $jQ = jQuery.noConflict();

  $jQ(document).ready(function(){
    $jQ('#Comments').attr('value','');
  });
</script>

Anonymous
Not applicable

Re: What is the code to disable prefill/pre-pop for a single form field?

Thanks, Jep. That's the code I've been using. The problem is with leads who already have data in this field. For them, the old values for this field are still showing up in the drop down as an option. The value is saved in the lead record, but has been deleted as an option on the form. See below.
0EM50000000Q9BC.jpg

Here is the page URL where we're having the problem: http://resources.bazaarvoice.com/Connections.webinar.choice.html.
Jep_Castelein2
Level 10

Re: What is the code to disable prefill/pre-pop for a single form field?

@ Matt: yeah, that's how pre-filling for dropdowns works. You can modify the JavaScript from my link above to remove the last "option" from the "select" (pre-filling inserts the option at the end). I'm not a JavaScript developer, so can't help you writing the code unfortunately
Anonymous
Not applicable

Re: What is the code to disable prefill/pre-pop for a single form field?

Any resolution to this? We also have this drop down field issue.