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.

How to get $form object or $entry object?

  1. Jive Software
    Member

    How to get $form object or $entry object?

    I am using a filter that does not pass the $form object or $entry object as an argument...
    How can I access these from this filter?
    Is there a function I can call?
    I looked through the documentation but I did not see anything?

    add_action("gform_field_standard_settings", "my_marketo_settings", 10, 2);
    
    function my_marketo_settings($position, $form_id){
    
    global $form;
    global $entry;
    
    echo '<pre>';
    print_r($form);
    print_r($entry);
    echo '</pre>
    ';
    
    	if($position == 0) {
    	?>
    		<li class="marketo_setting field_setting">
    				<label for="field_marketo_label">
    						<?php _e("Marketo Field Name", "gravityforms"); ?>
    						<?php
    							gform_tooltip("form_field_marketo_name")
    						?>
    				</label>
            <input type="text"  id="field_marketo_name" class="fieldwidth-3" onfocus="SetFieldProperty('marketoName', this.value);" value="" size="35"/>
    
    	<?php
    	}
    }
    add_action("gform_field_standard_settings", "my_marketo_settings", 10, 4);
    
    function my_marketo_settings($position, $form_id, $form, $entry){
    
    echo '<pre>';
    print_r($form);
    print_r($entry);
    echo '</pre>';
    
    	if($position == 0) {
    	?>
    		<li class="marketo_setting field_setting">
    				<label for="field_marketo_label">
    						<?php _e("Marketo Field Name", "gravityforms"); ?>
    						<?php
    							gform_tooltip("form_field_marketo_name")
    						?>
    				</label>
            <input type="text"  id="field_marketo_name" class="fieldwidth-3" onfocus="SetFieldProperty('marketoName', this.value);" value="" size="35"/>
    
    	<?php
    	}
    }
    add_action("gform_field_standard_settings", "my_marketo_settings", 10, 3);
    
    function my_marketo_settings($position, $form_id){
    
    $form = get_form_by_id( $form_id);
    // Not sure how to get entry??
    
    echo '<pre>';
    print_r($form);
    echo '</pre>';
    
    	if($position == 0) {
    	?>
    		<li class="marketo_setting field_setting">
    				<label for="field_marketo_label">
    						<?php _e("Marketo Field Name", "gravityforms"); ?>
    						<?php
    							gform_tooltip("form_field_marketo_name")
    						?>
    				</label>
    
    <input type="text"  id="field_marketo_name" class="fieldwidth-3" onfocus="SetFieldProperty('marketoName', this.value);" value="" size="35"/>
    
    	<?php
    	}
    }
    Posted 12 years ago on Thursday September 6, 2012 | Permalink