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

TOPIC:

(SOLVED): Where do you set a field to hidden? 01 Aug 2015 04:54 #13368

I have a field that I want hidden, but cannot see where to set the type. I've had a look at the view / modal and controller with no luck? Can someone please advise where to set this? I can't see class - controls in the css either? I really need some help as this is the last piece of the puzzle for my component. Can I set it amongst the following code for the input field?
<div class="controls">
			<?php echo $field->input; ?>
		</div>

In the form view I had
<div class="control-group <?php echo 'field-' . $field->id . $field->responsive; ?>">

I researched and have changed to
<div class="control-group <?php echo 'field-' . $field->id . $field->responsive; ?>">style="display:none">

which hides the corresponding field - this works on all fields in the view.

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

Last edit: by jonathanbell. Reason: Found Solution so closed with answer

(SOLVED): Where do you set a field to hidden? 03 Aug 2015 13:00 #13371

I do a variance of this so I don't lose hidden fields or have to alter them individually

If I have a load of hidden fields that I will be injecting values in from the URL (POST / GET) I create a FORM BRICK called hidden (alias)

I then just give the entire brick a class of hidden and add .hidden {display:none;) to my component style sheet

All hidden variables neatly package in their own (view)_hidden.php TMPL file
Morgan Leecy MCSE

Novell / Linux
PHP. MYSQL, Apache, node.js
Coldfusion, JQuery, HTML5
Joomla
The following user(s) said Thank You: admin, jonathanbell

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

(SOLVED): Where do you set a field to hidden? 04 Aug 2015 07:43 #13373

Thank you, I learn something new everyday, I'm sure there are more like me who are trying coding in a new language (me over 40) and struggle a little to ask the right question when searching or plain just don't understand what we are looking at. Anything new I learn as I go I will post as an answer. I'm sure if we all take the time to answer even the smallest question , even if only to point people in the right direction we all benefit.

So thanks Morgan, some of your advice on my previous questions has been invaluable. :) and I sincerely appreciate it.

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

Last edit: by jonathanbell. Reason: Grammar needed fixing.

(SOLVED): Where do you set a field to hidden? 04 Aug 2015 10:15 #13374

  • admin
  • admin's Avatar
  • Offline
  • Administrator
  • Administrator
  • Chef
  • Posts: 3711
  • Thank you received: 986
Another way is far more easy : use the 'hidden' type (native Joomla)

In your XML form :
<field name="myFieldName" type="hidden"/>

Otherwise, if you are using JDom, you can also use the following control : 'html.form.input.hidden'

Simple isn't it ?
Coding is now a piece of cake
The following user(s) said Thank You: jonathanbell

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

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

For starters it's just so easy to design an app in a way that I'm used to i.e. database first then views followed by customization. The fork system is pure brilliance from a developer standpoint as I can override things and still add and update my projects with minimal effort! Truly amazing to be able to build components in Joomla using incremental refinement without having to do everything by hand. Thanks for the great tool! I am so much more productive now than ever and I can't imagine building components any other way!!!!
Dave (Forum)

Get Started