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.

Moving the Add Notes Box in 1.6

  1. mark.dillon
    Member

    On the entry detail screen I would like to add a Notes section in GF 1.6 on the right hand side— basically to make it match the notes section in GF 1.5.

    I placed the following code between lines 367 and 379 in the entry_detail.php file:

    <!-- =Begin Custom Notes Section EDITED by MD -->
    <div class="postbox">
    	<h3 style="cursor:default;"><span>Notes</span></h3>
    	<div class="inside">
    		<textarea name="new_note" style="width:100%; height:100px; margin-bottom:4px;"></textarea>
    			<?php
    			$note_button = '<input type="submit" name="add_note" value="' . __("Add Note", "gravityforms") . '" class="button" style="width:60px;" onclick="jQuery(\'#action\').val(\'add_note\');"/>';
    			echo apply_filters("gform_addnote_button", $note_button);
    			?>
    	</div>
    </div>
    <!-- =End Custom Notes Section EDITED by MD -->

    As expected this code adds a new note, but each note created is empty.

    Posted 12 years ago on Monday November 7, 2011 | Permalink
  2. The problem is both textareas are named "new_note" and the original textarea in the left column is actually loaded lower in the page so when the page is submitted, the empty value takes precedence.

    You could change the name of your textarea and then update another bit of the core to save your custom field as well; however, for the sake of keeping your customzation consolidated in a single spot (making re-adding this for future versions nice and easy), I think it is easier to update the original textarea with the value of the new textarea on submit.

    http://pastie.org/2827143

    Posted 12 years ago on Monday November 7, 2011 | Permalink
  3. mark.dillon
    Member

    Thank you for the explanation, David! Having the correct code is great—but knowing why my code wasn’t correct is even more helpful. Resolved!

    Posted 12 years ago on Monday November 7, 2011 | Permalink
  4. Glad to help. :)

    Posted 12 years ago on Monday November 7, 2011 | Permalink

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