• Resolved netreneris

    (@netreneris)


    Hello Andrea,

    how are you? I have a problem and I hope that you could help me. I want to add a default value to the field “location”, but just in the “enter range” box. Now it’s set to “5”, but it repeats in both boxes – in the range box and in google location search box.

    I’m using this code snippet:

    add_action ('bps_field_before_search_form', 'set_default');
    function set_default ($f)
    {
    	if ($f->code == 'field_776')    // replace 34 with your field ID
    	{
    		// assign the default value
    		$f->value = 5;
    	}
    }

    The page I need help with: [log in to see the link]

Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘default value’ is closed to new replies.