Advanced HTML - Change Multiple States (or stop reset)

Put your questions here on how to do things in ProtoShare.
sapiensgladio
Posts: 1
Joined: Fri May 13, 2011 10:09 am

Advanced HTML - Change Multiple States (or stop reset)

Postby sapiensgladio » Fri May 13, 2011 10:18 am

For those of you interested in changing the state (or multiple states) within an Advanced HTML component without resetting all other states, here is the solution:

JavaScript to add:
<script type="text/javascript">
var pageState;
var addState1;
var addState2;
setState = function(){
pageState = '';
pageState = window.top.site9.StateMgr.get( 'ps' );
pageState = pageState + ',' + addState1 + ',' addstate2;
window.top.site9.StateMgr.set( 'ps', [pageState] );
}
</script>

HTML Example:
<a href="#" onclick="setState()">Add States</a></li>

Note: Just add the state stateID and valueID (found in the component box) to "addState1" and "addState2" (above). They are formatted as follows: "1680.1"

This will allow you to update a specific state (or multiple states) without resetting the other states.

Cheers,
Rob

Return to “How Do I...”

Who is online

Users browsing this forum: No registered users and 7 guests

cron