0

I have set up a form with advanced custom fields on the frontend in order to allow posts being generated from the frontend.

The form works but every time I visit the page with the form the form is prefilled with values however in the custom field setup I have no default value specified.

here is the code I am using.

<?php acf_form_head();
get_header(); ?>

<div id="primary" class="site-content">
    <div id="content" role="main">

        <?php the_post(); ?>

        <?php 

         $options = array(
            'post_id' => 'new',
            'field_groups' => array(36),
            'submit_value'  => 'Create Quote Request' , 
            'updated_message'  => 'Quote Created!' 

        );

        acf_form( $options ); ?>

    </div><!-- #content -->
</div><!-- #primary -->

<?php get_footer(); ?>

Any advice is appreciated.

stephan2307
  • 347
  • 1
  • 4
  • 16

2 Answers2

0

Change 'Create Quote Request' to ' ' because that's the text populating your text box... so removing it will stop populating it.

stink
  • 865
  • 8
  • 19
  • 2
    If You provide the answer please spend some time an write at least short comment with explanation. – zero323 Nov 03 '13 at 02:02
  • Nope. 'Create Quote Request' is the value of the submit button not of the field. I have a number of fields and they all are prefilled not just a single one. – stephan2307 Nov 04 '13 at 08:42
  • Sorry my mistake. When you right click in the browser to inspect element does it look like this ``? – stink Nov 05 '13 at 02:22
0

I ran into the same problem. I couldn't figure out how to unset it properly, so I jQueried it. Hope this helps.

$(".reset").ready(function() {
    $('.acf-form').find("input[type=text], textarea").val("");
});

Replace .acf-form with either your form id or class

I altered to my needs from this: Clear form fields with jQuery

Community
  • 1
  • 1
Ryan
  • 71
  • 2
  • 3