PHP Classes

Passing array pointer to "select"

Recommend this page to a friend!

      PHP Forms Class with HTML Generator and JavaScript Validation  >  PHP Forms Class with HTML Generator and JavaScript Validation package blog  >  How to Show Google Ma...  >  All threads  >  Passing array pointer to "select"  >  (Un) Subscribe thread alerts  
Subject:Passing array pointer to "select"
Summary:Passing array pointer to "OPTIONS" where "THPE"=>"select"
Messages:2
Author:Mark Allen
Date:2006-07-10 08:08:24
Update:2006-07-10 20:15:41
 

  1. Passing array pointer to "select"   Reply   Report abuse  
Picture of Mark Allen Mark Allen - 2006-07-10 08:08:24
This might be a newbie question, but .....

I have an array $array retrieved from mysql. The array has the format [optionNum,optionName]. I want to pass this array to the "OPTIONS" tag of the AddInput() function where "TYPE"=>"select".

Is there any way to do this without explicidly doing so in a loop?

  2. Re: Passing array pointer to "select"   Reply   Report abuse  
Picture of Manuel Lemos Manuel Lemos - 2006-07-10 20:15:41 - In reply to message 1 from Mark Allen
Not really, sorry. Currently the class only takes arrays with entries in the form of optionName => optionValue . You would have to convert your query results.

If you are using select inputs linked to other inputs, you may want to try the variants of the linked_select custom input that take database queries as parameters to retrieve the select input options.