Arend
-
Posts
2 -
Joined
-
Last visited
Posts posted by Arend
-
-
Struggling with a dropdown menu in a form. What I have is a plugin for Wordpress to make extra fields in an excisting form.
The problem that the menu is not filling with values and what ever I do nothing good is happening.
Could someone please help to get on the right track?
Greetz Arend
The code I am using;
function gma_wpjmef_frontend_add_doelgroep_info_field( $fields ) { $fields['job']['job_doelgroep_info'] = array( 'label' => __( 'Select One ', 'extra-field' ), 'type' => 'select', 'required' => false, 'placeholder' => '', 'omschrijving' => '', 'priority' => '8', 'be' => 'Belgium', 'lu' => 'Luxembourgh', 'nl' => 'Netherlands' , ); foreach ($fields['job']['job_doelgroep_info'] as $key => $value) { echo ' <option value="<echo $value; >"<<echo $key;></option>'; }; return $fields; }
-
I am Arend and a bite of a noob in PHP code. Lost knowledge of PHP scripting and hoping with this forum to renew my brain with the correct syntaxis. ;=))
Greeting from the Netherlands
Arend
Dropdown in array and foreach
in PHP Coding Help
Posted
Thank ypu for your input.
I took a look in the templates of Wordpress and came up with a solution
This code is working for me maby someone good use this also. ;=))
Greetz
Arend
<
function gma_wpjmef_frontend_add_doelgroep_info_field( $fields ) {
$fields['job']['job_doelgroep_info'] = array(
'label' => 'Select',
'type' => 'select',
'required' => false,
'placeholder' => '',
'omschrijving' => '',
'priority' => '8',
'options' => array(
'option1' => 'This is option 1',
'option2' => 'This is option 2'
)
);
return $fields;
}
>