<div>Hi Arto Pastinen</div>
<div>That was a type error. I had tried that ($locations_arr), but it did not work.</div>
<div> </div>
<div>In my custom .module file</div>
<div> </div>
<div>I have declared array at starting of file.</div>
<div> </div>
<div>In _form API, I was trying to use array. It did not work.</div>
<div> </div>
<div>I got a work around, I wrote a function that returns the array, and in code (in multiple functions), I am just calling the function that returns the array and using it.</div>
<div> </div>
<div>Thanks</div>
<div>Kamal</div>
<div> </div>
<div> </div>
<div> </div>
<div> </div>
<div> </div>
<div><br><br> </div>
<div class="gmail_quote">On Sun, Aug 26, 2012 at 4:14 PM, Arto Pastinen <span dir="ltr"><<a href="mailto:arto.pastinen@gmail.com" target="_blank">arto.pastinen@gmail.com</a>></span> wrote:<br>
<blockquote style="BORDER-LEFT:#ccc 1px solid;MARGIN:0px 0px 0px 0.8ex;PADDING-LEFT:1ex" class="gmail_quote"> '#options' => locations_arr, -> '#options' => $locations_arr,<br><br>2012/8/26 Kamal Palei <<a href="mailto:palei.kamal@gmail.com">palei.kamal@gmail.com</a>>:<br>
<div>
<div class="h5">> Hi All<br>> I am using betterselect module. I have a custom form, part of code looks as<br>> below.<br>><br>> $locations_arr = array(<br>> '0' => t('-Select-'),<br>
> '1' => t('Anywhere in India'),<br>> '2' => t('Anywhere in North India'),<br>> '3' => t('Anywhere in South India'),);<br>><br>> $form['name']['prefloc'] = array(<br>
> '#type' => 'select',<br>> '#multiple' => TRUE,<br>> '#title' => t('Preferred Work Location'),<br>> '#options' => locations_arr,<br>> );<br>
> When I access the form page, I get warning "warning: Invalid argument<br>> supplied for foreach() in<br>> C:\http\wamp\www\netcloudjobs\sites\all\modules\betterselect\betterselect.module<br>> on line 104.".<br>
><br>> Please let me know, where I am wrong and how to fix this issue.<br>><br>> Thanks<br>> Kamal<br>> NECS, Bangalore<br>><br>><br>><br></div></div>> --<br>> [ Drupal support list | <a href="http://lists.drupal.org/" target="_blank">http://lists.drupal.org/</a> ]<br>
<span class="HOEnZb"><font color="#888888"><br><br><br>--<br>regards, Arto Pastinen<br>GPG key on <a href="http://wwwkeys.de.pgp.net/" target="_blank">wwwkeys.de.pgp.net</a>, FP: DF04 1644 0812 9633 306F 9CCA 660C<br>285F 501C 8312<br>
--<br>[ Drupal support list | <a href="http://lists.drupal.org/" target="_blank">http://lists.drupal.org/</a> ]<br></font></span></blockquote></div><br>