Please enable JavaScript to view this site.

Navigation: Advanced topics > Programming topics > JavaScript API > RunnerPage object > Methods

JavaScript API: RunnerPage object > toggleItem()

Scroll Prev Next More

 

Shows or hides a page element in JavaScript events. If you need to show or hide multiple elements at once use toggleItems() function which will do the job much faster.

Syntax

toggleItem( itemId, show, recordId );

Arguments

itemId

the element ID. You can use this method only with the items (elements) that have an ID. How to find item ID?

show

use true to show the item, and false to hide it.

recordId

an optional {integer}. A unique identifier of a record in a data grid on the List page. With this parameter, you can show/hide elements in specific grid rows.

Note: use the recordId() function in the GridRow object to obtain this parameter.

Return value

No return value.

Example

//show the login form
pageObj.toggleItem("loginform_login", true );
 
//or hide the login form
pageObj.toggleItem("loginform_login", false );

 

 

Remarks
 

Hidden Edit controls are submitted with the form and saved in the database. Hidden controls will be filled by the Autofill feature. You can apply default values to hidden controls.

 

See also:

RunnerPage class: hideItem()

RunnerPage class: showItem()

JavaScript API: RunnerPage object > hideField()

JavaScript API: RunnerPage object > showField()

AJAX helper object

Click action

Field events

JavaScript API: RunnerPage object

JavaScript API