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.092 seconds
  I still don't believe he can really be human to do all this ! From all of the forums that I've ever participated in this is certainly the one that most encapsulates the feeling of being truly open source where everyone's opinions and contributions can and will shape the development of the service! It's truly awesome! Hope you enjoy cooking and look forward to reading and contributing to any of the editorial work that you proposed too!! Thanks
Gez (audibleid - JED)

Get Started