PHP Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me

The Shed is going Social! Join us on FaceBook and Twitter and chime in on the conversation.

Go Back   Dev Shed ForumsProgramming LanguagesPHP Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old December 17th, 2012, 06:06 PM
sethwcaton sethwcaton is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Dec 2012
Location: Pennsylvania
Posts: 1 sethwcaton User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 6 m 20 sec
Reputation Power: 0
Facebook
Unhappy Code Critique - Can't get PHP populate select list code in Joomla! BreezingForms to work

I'm using the exact code snippet (Step 1 of the Simple Version) from this page hosted by the developers of BreezingForms for Joomla!, modified only to have the correct table and field names, and the name of the select list in the form: [[OK, so I guess I can't post links. I hope you can still help.]]

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: [[OK, so I guess I can't post links. I hope you can still help.]]

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=========

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming LanguagesPHP Development > Code Critique - Can't get PHP populate select list code in Joomla! BreezingForms to work

Developer Shed Advertisers and Affiliates



Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 


Powered by: vBulletin Version 3.0.5
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.

© 2003-2013 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap