Changing default styles

<style>
.pf-required-field {border-style: dotted; border-width: 2px; }
.pf-button {background-color:blue; color:#ddd;}
.pf-button:hover {color:#fff;background-color:#000000;cursor:pointer;}
.pf-button:active {color:#fff;background-color:#f0713a;}
.pf-button:disabled {color:#aaa;background-color:#f2f2f2;}
.pf-toolbar-button {height:80px;width:75px;}
.pf-section-header-text {font-size:14px; color:#3333FF; float:left;}
.pf-picker-item:hover {color:#000; border-color:#999; background-color:#fff;}
</style>

Conditional customizations
Sometimes in Sharepoint, there may be a need to have more than one form layout for an individual list. Different fields or form designs may be required to differentiate between field values.
For example using a customers list, we may need to paint the form’s background blue if the gender is male and pink if female.
PowerForms HTML supports different customizations for each list. By default, each form automatically creates a customization with no conditions applied and this customization is used every time the form appears.
In order to see the different form layouts, we select the following button on the editor screen:

A form containing the default customization appears:

Let’s describe how to create a second form layout for the same list. For our example, we’ll need to present a different form to the user everytime the item’s title is test. To do so, we follow these steps:
– Select the default condition
– Enter our conditional statement in the Create copy with condition box. In our case, we want to automatically load this form customization every time the title is test. The statement is:
“{Title}”=”test”
– Press on the Copy button.

*Note : You should use the field’s Sharepoint name when trying to create a conditional statement and not the name given by the designer. i.e. notice we are using Title instead of c_Title.
From this point on, this customization will automatically load everytime the title is test. To visually differentiate between the two customizations, we select our newly created condition and press on theSelect button. This causes the editor to load the selected customization.

Using the Editor, we decide to change the background color of the c_Title field to red. This means that everytime the Title is test, the box will have a reddish hue else it will be white.
Title is test

Different Title

You can edit the conditional statement by going to the design form and selecting Options.
Lazy Loading for Tabs
This option is introduced to help shorten PowerForms loading times, when your form contains a large number of information shown in multiple tabs. To access this property, click on the Properties icon on any tab.

Lazy Loading will cause the Tab to load it’s data only when it is clicked and brought to the foreground. Doing this for multiple tabs means that only the first tab will load it’s information, therefore reducing the initial loading/waiting time. Clicking on the other individual tabs will cause them to load their relevant information.
Define Calculated Fields and Visibility/Enabled formulas
One of the options available with every control is to provide its value using a calculation formula. By setting a field to be calculated, you have to define the calculation formula for the field values.
You can also use calculation formulas in the “Visibility formula” and “Enabled formula” properties, on the General tab. These formulas should always return a Boolen (True/False) value to indicate whether a control should be visible/enabled or not.
The calculation formulas use Javascript like syntax and a guide on how to use them is available in Form Properties and Methods.
To reference the value of a control i.e. c_Control1 which contains text, simply use the following syntax:
|
1
|
“{c_Control1}”
|
The above expression is the equivalent but shorter version of the following:
|
1
|
form.GetControl(“c_Control1”).GetValue()
|
For example, let’s assume we have 2 controls on our form
c_Control1 is a Textbox
c_Control2 is DateTimePicker
Our example form looks like the following:

We decide to use a calculation formula on the Textbox control (c_Control1), so that anytime a date is selected on c_Control2, c_Control1’s text will display:
Selected Date : followed by the selected date.

Note:
You can also have the same result by typing in the following expression:
|
1
|
“Selected Date : {c_Control2}”
|
After saving the above changes, everytime a date is selected on the DateTimePicker control the Textbox control will show:
Hello world!
Welcome to WordPress. This is your first post. Edit or delete it, then start writing!
This is a post with post format of type Link
Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Aenean commodo ligula eget dolor. Aenean massa. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Donec quam felis, ultricies nec, pellentesque eu, pretium quis, sem. Nulla consequat massa quis enim.
Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Aenean commodo ligula eget dolor. Aenean massa. Cum sociis natoque penatibus.
