Hiding Section in InfoPath 2003 - infopath

I am creating an infopath form in 2003 where I only want certain sections/controls to appear based on the users choice. I am aware that there are rules and conditions that will have to be applied to this, however I have already added all of the section/fields that need to appear when a user selects an option from the dropdown. My main question is, how do I hide this info on the form? At the moment when I select 'Preview Form' ALL of the sections appear and no option has been chosen yet. How do I hide these until a user makes a selection. I hope answering this question, will help me with the rest of the form.
Thank You~

You are allowed to specify multiple conditions in the conditional formatting options for a section. The easiest way for the section to be hidden on load is to set the conditional formatting for the section to your normal rules OR is blank.
So for example - you have a dropdown that has members Select, Show, Hide. Your conditional formatting on the section should be hide whenever Hide is chosen OR hide whenever Select is chosen (note that the default value of Select for a dropdown is "is blank").

Let's assume you have 1 drop down list and 2 section. Initially the 2 sections should be hidden, when the user selects a value from the drop down list you will show one of these 2 sections based on the ddl selected value.
Add a field to your schema called firstTime with default value 0.
Section 1 will be hidden if firstTime = 0 or ddlChoice = 2
Section 2 will be hidden if firstTime = 0 or ddlChoice = 1
When the ddl index changes set firstTime to 1. This way the first part of the condition won't have any effect and you will only depend on the value of the drop down list to show / hide the sections.

Related

How to dynamically change default value of the drop down field of the gravity forms depending on the selection before landing on the form page

I have a page with a pricing table:
plan A
plan B
plan C
I want to use only one gravity form with a drop down default value filled depending on what the user have selected.
For example, if the user selected 'plan B' from the pricing table, the form will show the drop down 'plan B' selected by default.
Can someone help me with this?
In Gravity Forms for your dropdown you will have a value. I found that as long as the value was one word it was easy to get it to be the default.
For you I would name each of your three things PlanA, PlanB, PlanC
Make sure show values is checked if you want it to be required.
Go over to the Advanced tab check the "Allow field to be populated dynamically" box and then for the parameter name enter a variable. I used default_value. Then on your different Plan names in your table you will need to add this. Plan A
where "planForm" is obviously the link of your page and the default_value is equal to the value of the dropdown item you wish to be default.

Simple Hierarchical select drupal 7

i was created select hierarchy ( taxonomy with 3 level), but in default it's show only one level , how i can display all 3 level in default page? :
-Any- + -Any- + -Any-
I do not want it automatically generates other fields! I want to display by default all the select input
Simple Hierarchical select works on the basis of taxonomy term hierarchical structure, meaning consider you selected a term which has child in first drop down. As soon as you select term which has a child term, another drop down box will appear and if you select a term within that box which has another child term in-turn then another drop down will appear. This process continues to any deeper level. So displaying all drop down box by default is not possible as it depends upon user selection in first drop down.
In your case, as far as attached screen shot considered, first drop down's default value is 'none' and as you know 'none' value wont have any child item. So no default display of all drop down.
If you want you could do this, go to your Content Type's 'Manage Fields' section and edit Simple Hierarchical Select field and select default value which has child terms other than none.

Remove Style from table in Code Behind

This should be a lot easier than it appears to be, but I'm having an issue with it.
Conditions
If upon entering this specific page, if there is only one record in the grid (based on a status value in a dropdown), hide the grid and show a table with the details of that record.
If there is more than one record, display the grid with the records.
When a record is selected, display the table with the details of that record.
When I go into the page currently, there is only one record, so it is displaying the table. If I change the value of the dropdown to another status, more than one record is in the grid and the table is hidden. Previously (by another programmer) it was being set to Visible = false. Obviously, this is not a property of the table. However, it previously worked as when someone would select a row, they would set the Visible = true and the table would show.
I've now changed it to hide by using:
tblDetails.Attributes("style") = "display:none"
However, trying to replace the Visible = true is not working:
tblDetails.Attributes.Remove("style")
I have also tried:
tblDetails.Attributes("style") = ""
Someone please point out to me the solution that is going to make me slap my forehead. Thanks.
use setAttribute(attr,value) to change the value of each Element You want
like below example
yourelement.setAttribute("style","");//it is to change value
yourelement.removeAttribute("style")//it is used to remove style attrb from your element

InfoPath 2010 field validation in repeating section

I would like to put simple validation when check box is checked it should make one of the field mandatory to fill.Here is my form,
All checkboxes are bind with "Control1" Question section and the field I want to validate is bind with "Value" of Answers section. Problem is whatever condition I write it's getting repeated for all the check boxes. For example, All the check boxes has some unique id like QUE1 so even if I would like to use unique id on check boxes it's not working because same is applying to all the check boxes.
Any idea how to achieve this?

Drupal: Views: how to group fields

I've created a views of node and I've selected the "fields" option in order to select which fields to display and in which order.
Is there a way to group such fields ? It would be very useful to have parent divs in my html code.
thanks
There's a simpler way to do it: http://www.arsnova.cc/web-development-articles/2012-07-27/grouping-fields-together-drupal-views
Let's say you want to group fields 1-3 together within a div.
First, exclude fields 1 and 2 from display. (By "exclude", I do not mean to delete them from the views display; rather, click on the "exclude from display" button within each field's options.) The fields you exclude from display must come before the other field for this to work. If they don't, rearrange them so they do.
Go to field 3, and rewrite the results, inserting the token for each of fields 1-3.
That's all you need to do. Fields 1, 2, and 3 will now appear within field 3's div. If you want, you can also add additional markup within the "rewrite results" area.
Recently found the best way for my needs and apparently for the needs of many people:
Use views_fieldsets module https://drupal.org/project/views_fieldsets, it allows yo to create a grouping div to put fields inside.
Grouping is built into Drupal 8 Views. So no need for any extra modules. Here's how:
Edit your view (be sure it has fields)
Click Format's Settings
A box will pop up with all your selected fields
Look right underneath all the field names, there should be "Grouping field Nr.1"
Select the field you'd like to group by
Click Apply
If you want to subgroup with a second field, just go back to 2 then you'll see "Grouping field Nr.2"
That's it.
Yes, click on the gear next to the Style option (under Basic Settings) and set the Grouping field. Keep in mind, the grouping field needs to be added to the view, but you can check the Exclude from display option to hide it, if needed.
I'm pretty sure that would give you a parent div. If not, you could add the parent div, by overriding the default templates (look to the Theme: Information section, under Basic Settings, for more information).

Resources