Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: PHP MySQL list ListBox form CMS , +
I'm using the exact code snippet (Step 1 of the Simple Version) from this page hosted by the developers of BreezingForms for Joomla! CMS, modified only to have the correct table and field names, and the name of the select list in the form: http://crosstec.de/media/kunena/attachments/59203/BreezingFormsscriptdev.txt
 
All I want to do in BreezingForms is to populate a select list with the "address" field as name and "buildingID" as value. I don't need the scripts in Step 2, 3, etc. because I don't need to populate other form fields. However with this code inserted in Advanced > Form Options > Form Pieces > Before Form box, the select list fails to even show up on the page with the form, see here: http://catondesigngroup.com/websites/joooid/select-test/view/form.html
 
The form field label "Select List" is there, but the select list box fails to appear. I don't see any reason why it doesn't work. What's wrong here? Please help!
 
Note: I omitted these two lines of code because I don't need usernames or user ID's, however trying to implement these lines of code does help any:
 
$user = &JFactory::getUser(); // get the user via JFactory
$userid = $user->id; // you may need to use a different value for this or none
 
=========START CODE=============
 
        this->execPieceByName('ff_InitLib');
        
        $rows = ff_select("SELECT buildingID, address
        FROM ty43k_building_inspection");
        $listdata = "0;Please make a selection;0\n";
        for ($i = 0; $i < count($rows); $i++) {
        $listdata .= "0;{$rows[$i]->address};{$rows[$i]->buildingID}\n";
        }
        
        ff_setSelectList('select1', $listdata);
        
        function ff_setSelectList($name, $value) {
        global $ff_processor;
        for ($r = 0; $r < $ff_processor->rowcount; $r++) {
        $row =& $ff_processor->rows[$r];
        if ($row->name==$name)
        $row->data2 = $value;
        unset($row);
        } // for
        
        } // ff_setSelectList
========END CODE=========
 
[edit]code block added[/edit]
Posted 17-Dec-12 12:52pm
Edited 17-Dec-12 13:09pm
(no name)63.3K
v3

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
0 OriginalGriff 6,165
1 DamithSL 4,658
2 Maciej Los 4,107
3 Kornfeld Eliyahu Peter 3,649
4 Sergey Alexandrovich Kryukov 3,382


Advertise | Privacy | Mobile
Web03 | 2.8.141220.1 | Last Updated 17 Dec 2012
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100