How do I activate more than one state in advanced html

Put your questions here on how to do things in ProtoShare.
artonic
Posts: 10
Joined: Tue Dec 27, 2011 9:21 pm

How do I activate more than one state in advanced html

Postby artonic » Fri Nov 10, 2017 10:59 pm

I have this code to use in an Advanced HTML Component to link to a State:
<a href="" onclick="window.parent.site9.PageStateMgr.getState('500').setValue('1');">

My question is, how do I make that link work for multiple states at once?

Jamie Ramani
Posts: 7
Joined: Wed May 27, 2009 12:37 pm

Re: How do I activate more than one state in advanced html

Postby Jamie Ramani » Tue Nov 14, 2017 1:02 pm

To carry on using the same format, you could add a second state and value using something like this:

<a href="" onclick="window.parent.site9.PageStateMgr.getState('500').setValue('1');window.parent.site9.PageStateMgr.getState('501').setValue('1');">

However, your best bet may be to use a different technique if you plan on adding multiple states to your on click action. Here's a blog post that has a good example of how you might to do so: http://community.protoshare.com/2013/07 ... es-states/
Jamie Ramani
customerservice@protoshare.com
Site9, Inc. / Customer Support
blog.protoshare.com | twitter.com/protoshare


Return to “How Do I...”

Who is online

Users browsing this forum: No registered users and 2 guests

cron