Welcome, Guest
Username: Password: Remember me
  • Page:
  • 1

TOPIC:

Dropdown in Form 30 Oct 2012 07:56 #4848

Is it possible to add a dropdown to the form in Cook? for example, I have an Integer field. Instead of a text box I want to add a dropdown with integers assigned as the values.

Example:
<select>
  <option value="1">Option 1</option>
  <option value="2">Option 2</option>
</select>

Instead of this:
<input type="text" name="Option">

See the Server field in the screenshot.

--
Jerry Benton

Please Log in or Create an account to join the conversation.

Last edit: by jcbenton.

Re: Dropdown in Form 30 Oct 2012 08:36 #4850

  • JoomGuy
  • JoomGuy's Avatar
  • Offline
  • Moderator
  • Moderator
  • Joomla Enthusiast, Lover of Cooking
  • Posts: 1115
  • Thank you received: 195
1 - you could either use an FK field to grab values into a combobox (dropdown) by
  • dragging an Foreign Key field type to your table
  • dragging the table element to the FK field
  • select a field from foreign table, i.e. title to use as label
OR

2 - you could use an enum type field
  • drag enum field type to your table
  • populate the value|label pairs
Need help with your Cook/Joomla Project? . PM me to find out what I can help with. NO time wasters please!!!

Please Log in or Create an account to join the conversation.

Re: Dropdown in Form 30 Oct 2012 08:41 #4852

  • JoomGuy
  • JoomGuy's Avatar
  • Offline
  • Moderator
  • Moderator
  • Joomla Enthusiast, Lover of Cooking
  • Posts: 1115
  • Thank you received: 195
Ignore previous post!

Sorry, just coming to life here...

jcbenton wrote: See the Server field in the screenshot.


Can you see some left/right buttons over to the right of your field? Use them to switch to combobox. That should do the trick for you.

Gez
Need help with your Cook/Joomla Project? . PM me to find out what I can help with. NO time wasters please!!!

Please Log in or Create an account to join the conversation.

Re: Dropdown in Form 30 Oct 2012 08:53 #4854

Ok I added another table and made the dropdown. I will try it out in the sandbox. Thanks.
--
Jerry Benton

Please Log in or Create an account to join the conversation.

Re: Dropdown in Form 01 Nov 2012 11:28 #4889

  • admin
  • admin's Avatar
  • Offline
  • Administrator
  • Administrator
  • Chef
  • Posts: 3711
  • Thank you received: 986
As said @audibleid,

You can use the tiny buttons at the right to change the input aspect (list, combo, radio)
This part of the builder is lacking a little bit (graphical), but it works.
Coding is now a piece of cake

Please Log in or Create an account to join the conversation.

  • Page:
  • 1
Time to create page: 0.067 seconds

This is what you call a component builder. I was able to master using this in a very short time and the resulting component works like a charm. Not just a basic component builder but a fully working component builder with forms fields tables all ready to go. You can make the list and item views to display in the front and back end. Also there is a great forum just starting to evolve and I'm sure this will grow very rapidly when you all realise how good this tool is.
Kevin (JED)

         

Get Started