pgjacob Posted October 20, 2017 Report Share Posted October 20, 2017 I was wondering if you could conditionally display deploy code based on a passed parameter. If the parameter = X, then show the deploy code, if not, then hide it. thanks Quote Link to comment Share on other sites More sharing options...
Mathilda Posted October 23, 2017 Report Share Posted October 23, 2017 On 10/20/2017 at 6:50 PM, pgjacob said: I was wondering if you could conditionally display deploy code based on a passed parameter. If the parameter = X, then show the deploy code, if not, then hide it. thanks I would hide datapage is parameter is not equal to X. You may find an example below: <script type="text/javascript"> window.onload= function my_funct(){ var check='[@param]'; if (check != 'X'){ document.getElementById("caspioform").style.display = 'none'; } } </script> Quote Link to comment Share on other sites More sharing options...
pgjacob Posted October 23, 2017 Author Report Share Posted October 23, 2017 Thank you. But how do I arrange this in the webpage. Do I embed the deploy code within this hide function or are they separate? And if there are several conditions, can I just add in more statements or do I use an OR statement?, e.g. var check='[@param]'; if (check != 'X'){ document.getElementById("caspioform").style.display = 'none'; var check='[@param]'; if (check != 'Y'){ document.getElementById("caspioform").style.display = 'none'; Quote Link to comment Share on other sites More sharing options...
pgjacob Posted October 23, 2017 Author Report Share Posted October 23, 2017 I put this in the footer and I cannot seem to get it to work... The passed parameter is in the URL and I tested with this parameter,if the param (I substituted the field with the field picker) = passed parameter, then display is none, but it displays... http://itselementaryff.weebly.com/stats.html?playerid=491&position=D/ST&cbResetParam=1 param passed is D/ST, and the datapage footer as results is: <script type="text/javascript"> window.onload= function my_funct(){ var check='[@field:All_Players_Position]'; if (check !='D/ST'){ document.getElementById("caspioform").style.display = 'none'; } } </script> I tried it as the actual field name and also as the value I assigned to it when passing ([@position]) and it showed in both instances Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.