Bold,
Our ux team is revamping our articles and as a result have removed some of them. Here's the content you were looking for:
Clear a specific pre-populated form field
Here's a quick way to ensure a form field is always blank, clearing the value even if it was prepopulated from a previous fillout.
It will disable the form prefill on that field.
First, you need to get the ID of the field you want to clear.
Preview the landing page in your browser, then view the source for the page.
Then search for the label text you used for the field. You'll find the ID in the id field.
In this example, it's Test1__c:<label>Test1:</label><span class='mktInput'><input class='mktFormHidden' name="Test1__c" id="Test1__c" type='hidden' value="" />
Next, add this JavaScript to your landing page.
To add it to one page, drag on a Custom HTML element on the page. To add it to all your pages, add this to the landing page template for your form.
If this is a multiple select box, use this code and replace the Selection highlighed text with the ID of the form field you found above:
<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('#Selection option').removeAttr('selected');
});
</script>
Use the following for a pulldown field:
<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('#Selection option:first').attr('selected','selected');
});
</script>For all other cases, in the code below, replace Comments with the ID of the field you found earlier. Make sure to leave in the leading # sign.
<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>