Personal tools

Log in

Changes

From All n One's bxp software Wixi

Jump to: navigation, search

JavaScript - Title Block Hide Elements

1,811 bytes added, 08:56, 2 December 2014
Created page with " == Title Block Hide Elements == Through the user of a custom JavaScript function, BeX users are now able to hide the individual elements of the question type ''Complex - Tit..."

== Title Block Hide Elements ==

Through the user of a custom JavaScript function, bxp users are now able to hide the individual elements of the question type ''Complex - Title Block''.


To use the custom function, simply copy the below line of code into the ''Form Settings - JavaScript OnLoad - Opening code execution''


<source lang="javascript" collapse="true" first-line="1">

fn_General_ComplexTitleBlock_ShowHide ( strFieldId, blHideTitle, blHideFirstName, blHideInitial, blHideSurname );

</source>


When using the function call above you need to replace the following fields

'''1) strFieldId:''' Replace with the question Identifier i.e. strCDA_X_field_0_X

'''2) blHideTitle:''' Replace with ''true'' to hide the field, or replace with''false'' to leave the field visible

'''3) blHideFirstName:''' Replace with ''true'' to hide the field, or replace with''false'' to leave the field visible

'''4) blHideInitial:''' Replace with ''true'' to hide the field, or replace with''false'' to leave the field visible

'''5) blHideSurname:''' Replace with ''true'' to hide the field, or replace with''false'' to leave the field visible


'''Example 1'''

<source lang="javascript" collapse="true" first-line="1">
// * Hide the Initial field and the Surname field
fn_General_ComplexTitleBlock_ShowHide ( 'strCDA_602_field_0_2', false, false, true, true );
</source>

'''Example 2'''
<source lang="javascript" collapse="true" first-line="1">
// * Hide the Title field and the Initial field
fn_General_ComplexTitleBlock_ShowHide ( 'strCDA_602_field_0_2', true, false, true, false );
</source>

'''Example 3'''
<source lang="javascript" collapse="true" first-line="1">
// * Hide the initial field
fn_General_ComplexTitleBlock_ShowHide ( 'strCDA_602_field_0_2', false, false, true, false );
</source>