PLEASE NOTE: These forums are no longer utilized and are provided as an archive for informational purposes only. All support issues will be handled via email using our support ticket system. For more detailed information on this change, please see this blog post.

Hide field only if prepopulated

  1. charger15
    Member

    I have two fields (Title and Category Post Field) that can either be filled in manually or get prepopulated, depending on which way (direct link or redirect from post) you get to the form.

    I now would like to hide the two fields IF they get prepopulated. To set the visibility to Admin only won't help as it then is always hidden. Any ideas?

    Thanks!

    Posted 13 years ago on Tuesday August 23, 2011 | Permalink
  2. The only thing I can think of is to use PHP and output CSS to set those fields to display hidden depending on a query string parameter passed to it. There isn't currently a built in easy way to do this.

    Posted 13 years ago on Tuesday August 23, 2011 | Permalink
  3. charger15
    Member

    Thanks for your tip! This is how I solved it (code added to header.php):

    [php]
    <style>
    <?php
      // get ref parameter from query string
      $ref_id = $_GET['ref'];
      // if the parameter has a value (which means it is a redirect from another page), hide certain fields
      if(isset($ref_id)){
        echo "#field_1_17,#field_1_18{display:none;}"; //
      }
    ?>
    </style>
    Posted 13 years ago on Saturday August 27, 2011 | Permalink

This topic has been resolved and has been closed to new replies.