Forums

Using PHP to create "select" dropdowns

muecke06 10 Apr, 2015
Hi all,

First, information about my English, I'm German and my English is not perfect, so I use an online translator.

Either will work with my v5 Installation anything wrong (php 5.4) or am I doing something wrong.
The following tutorial I could understand under a v4 installation (Joomla 2.5):
http://greyhead.net/chronoforms/using-php-to-create-select-dropdowns

If this tutorial work for v5 with Joomla 3.4?
For me it does not work.

greeting
muecke
Max_admin 10 Apr, 2015
In v5 its easy, you can use this PHP code:

echo \GCore\Helpers\Html::formLine('field_name', array('type' => 'dropdown', 'label' => "my label", 'options' => array(0 => 0, 1 => 1), 'values' => 1));


Regards,
Max
Max
ChronoForms developer...
Did you try ChronoMyAdmin for managing your Joomla database tables ?
GreyHead 10 Apr, 2015
Hi muecke,

What exactly do you need to do - there are several different ways to do this.

Bob
muecke06 13 Apr, 2015
Good morning Bob,

I'm still testing at the moment, to what extent can I use CF for my purposes. I have built an intranet for our company years ago, this includes very large forms. Especially working with these external databases (ODBC driver).
The intranet will be revised based on Joomla. The forms I would like to achieve with ChronoForms because I think the CF includes all the features you need. I know this implement just have not really, I do not have a German manual. Is there a manual for v5, even if it is in English?
Here, I would be very grateful for a link, which I can well read something.

In this threat, it was primarily a matter of integrating a form of v4 in v5. I did me hard a query from v4 to integrate these functions in the v5. So there are still fundamental tests.

My real problem is just what I have to have a form field as a function of the user show or hide. The difference is with guests and registered users (id! = 0). I need here, perhaps a small tip.

I wish a good week.
Greeting muecke
GreyHead 13 Apr, 2015
Answer
Hi muecke06,

I'm afraid that there is no manual - it would need to be very big to cover everything :-(

As time allows we are adding FAQs and some videos.

To show/hide an input - or a group of inputs based on the user id I would probably use a Container of type custom. In the Start box add:
<?php
$user = JFactory::getUser();
$display = 'block';
if ( $user->id > 0 ) {
  $display = 'none';
}
echo "<div style='display: {$display}' >";
?>
Then add </div> in the End box.

You may need to switch over the 'block' and 'none'.

Bob
muecke06 13 Apr, 2015
Hi Bob,

many thanks.
One question: Could I have the boxes for the guests in a container (Type: Field Set) Set View Full let in "$ user-> id <0"?
Does it work with "start code" and "end code" in Edit Container Settings?

muecke

P.S. The ChronoForm book for v5 I would buy immediately ;-)
GreyHead 13 Apr, 2015
Hi muecke,

I think that the Start and End code boxes only work with containers of Type 'Custom'. But you could add a <fieldset> in the Start code box.

Bob
muecke06 13 Apr, 2015
Hi Bob,

thank you and sorry, I did not really read your answer / understood. I have now done it, it works. ;-)

Best Regards,
muecke
This topic is locked and no more replies can be posted.