hi there,
I use chronoforms v4. In a customcode element i have this:
In the form output i see this (printscreen). What goes wrong?? I't seems that it can find the data but the output becomes invisible?
[attachment=0]prod-output.png[/attachment]
I use chronoforms v4. In a customcode element i have this:
<select size="1" type="select" name="productenlijst">
<option value="">-------- producten --------</option>
<?php
$db =& JFactory::getDBO();
$query = "SELECT * FROM lw0bd_faqbook_items";
$db->setQuery( $query );
$option = $db->loadObjectList();
foreach($option AS $o)
{
$option = $debiteur->deb_snellenaam;
echo "<option value='" . $o->title . "'>". $option ."</option>";
}
?>
</select>
In the form output i see this (printscreen). What goes wrong?? I't seems that it can find the data but the output becomes invisible?
[attachment=0]prod-output.png[/attachment]
Hi Ritchie,
Please check this line - I'm pretty sure you don't want $option in there
Bob
Please check this line - I'm pretty sure you don't want $option in there
echo "<option value='" . $o->title . "'>". $option ."</option>";
Bob
Thnx..😀 thats it.
It has to be:
it works now :mrgreen: 😀 🤣
It has to be:
<select size="1" type="select" name="productenlijst">
<option value="">-------- producten --------</option>
<?php
$db =& JFactory::getDBO();
$query = "SELECT * FROM lw0bd_faqbook_items";
$db->setQuery( $query );
$option = $db->loadObjectList();
foreach($option AS $o)
{
$option = $o->title;
echo "<option value='" . $o->title . "'>". $option ."</option>";
}
?>
</select>
it works now :mrgreen: 😀 🤣
Hi Ritchie,
Looks as though you re-posted the un-fixed version of the code.
Bob
Looks as though you re-posted the un-fixed version of the code.
Bob
Hi Ritchie,
Looks as though you re-posted the un-fixed version of the code.
Bob
Hi Bob,
No it's slighty different:
The wrong code
foreach($option AS $o)
{
$option = $debiteur->deb_snellenaam;
echo "<option value='" . $o->title . "'>". $option ."</option>";
}
?>
The good code
foreach($option AS $o)
{
$option = $o->title;
echo "<option value='" . $o->title . "'>". $option ."</option>";
}
?>
$option = $o->title; instead of $option = $debiteur->deb_snellenaam;
This works for me anyway... 😀
Hi Ritchie,
Ah, I missed that, looks risky to me though as you are redefining $option in the middle of a loop that uses it. This might be neater
Bob
Ah, I missed that, looks risky to me though as you are redefining $option in the middle of a loop that uses it. This might be neater
foreach ( $option as $o) {
echo "<option value='{$o->title}' >{$o->title}</option>";
}
?>
Bob
Thnx Bob,
I change the code 😀. Bye the way... do you know how i can solve this problem http://www.chronoengine.com/forums.html?cont=posts&f=2&t=25487?
Regards
Ritchie
I change the code 😀. Bye the way... do you know how i can solve this problem http://www.chronoengine.com/forums.html?cont=posts&f=2&t=25487?
Regards
Ritchie
This topic is locked and no more replies can be posted.