Re: fill autocomplete with linkfield

From: Date: Thu, 07 Oct 2004 12:39:49 +0000
Subject: Re: fill autocomplete with linkfield
References: 1  Groups: php.pear.general 
Request: Send a blank email to pear-general+get-14792@lists.php.net to get a copy of this message
Leo Márquez wrote:
Hi, Is possible to fill a autocomplete element of a FormBuilder form with the data of the linkfield? I have created a predefelement autocomplete field and have filled the options with data obtained in previous lines. But, when I process the form it returns error because the value of the autocomplete field is not correct. I supose it expects to receive a numeric identificator, not the name that is used for the autocomplete. I need to pass another data that is used to the autocomplete. There is a way to do this using FormBuilder?
How does the autocomplete element work? If it doesn't provide the numerid ID of the record, you're screwed. I've built a "picker" element for my projects that opens an iframe which allows you to search for a record and then select it. When I click on the record, its ID value is copied (via Javascript) to a hidden field in the parent frame (this field must have the same name as the database field you wish to fill). Additionally, a <span> element is filled with the display value of the record, so you can see what record is selected after the iframe is closed. This all works very well, but it means writing your own element so that you can have both a display value and a numeric ID for the record. CU Markus

« previous php.pear.general (#14792) next »