<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://cm2.liecourt.com/index.php?action=history&amp;feed=atom&amp;title=Wiki%3AFeature%2F1562766781</id>
	<title>Wiki:Feature/1562766781 - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://cm2.liecourt.com/index.php?action=history&amp;feed=atom&amp;title=Wiki%3AFeature%2F1562766781"/>
	<link rel="alternate" type="text/html" href="https://cm2.liecourt.com/index.php?title=Wiki:Feature/1562766781&amp;action=history"/>
	<updated>2026-04-11T12:44:51Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.31.14</generator>
	<entry>
		<id>https://cm2.liecourt.com/index.php?title=Wiki:Feature/1562766781&amp;diff=186&amp;oldid=prev</id>
		<title>Maintenance script: Fill database</title>
		<link rel="alternate" type="text/html" href="https://cm2.liecourt.com/index.php?title=Wiki:Feature/1562766781&amp;diff=186&amp;oldid=prev"/>
		<updated>2020-05-13T19:24:55Z</updated>

		<summary type="html">&lt;p&gt;Fill database&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;{{Feature&lt;br /&gt;
|Name=Show on select&lt;br /&gt;
|Purpose=&amp;quot;Show on select&amp;quot; feature similar to PageForms, but for use in combination with WSForm&lt;br /&gt;
|Module=Wiki:Module/1530870565&lt;br /&gt;
|Version=1.0&lt;br /&gt;
|Status=Live&lt;br /&gt;
|Type=Basic&lt;br /&gt;
|Version notes=1.0 - First version&lt;br /&gt;
|Additional information=&amp;lt;h3&amp;gt;Installing this feature&amp;lt;/h3&amp;gt;&lt;br /&gt;
* Add the following code to [[MediaWiki:Common.js]]. Note that it will also work if you only have WSShowOnSelect.js without multipleInstanceTemplates.js, if you do not want to use the Multiple instance templates feature. &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
/* ***** Loading multipleInstanceTemplates and WSShowOnSelect ***** */&lt;br /&gt;
	if ($('.WSmultipleTemplateWrapper') &amp;amp;&amp;amp; $('.WSShowOnSelect').length == 0) {&lt;br /&gt;
		$.getScript('/wikis/modules/wsbasics/multipleInstanceTemplates.js');&lt;br /&gt;
	}&lt;br /&gt;
	&lt;br /&gt;
if ($('.WSShowOnSelect').length &amp;gt; 0 &amp;amp;&amp;amp; $('.WSmultipleTemplateWrapper').length == 0) {&lt;br /&gt;
	$.getScript('/wikis/modules/wsbasics/WSShowOnSelect.js').done(function() {&lt;br /&gt;
		WsShowOnSelect();&lt;br /&gt;
	});&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
if ( $('.WSShowOnSelect').length &amp;gt; 0 &amp;amp;&amp;amp; $('.WSmultipleTemplateWrapper').length &amp;gt; 0) {&lt;br /&gt;
	$.getScript('/wikis/modules/wsbasics/WSShowOnSelect.js').done(function() {&lt;br /&gt;
		$.getScript('/wikis/modules/wsbasics/multipleInstanceTemplates.js').done(function() {&lt;br /&gt;
			WsShowOnSelect();&lt;br /&gt;
		});&lt;br /&gt;
	});&lt;br /&gt;
}&lt;br /&gt;
/* ----- end of Loading multipleInstanceTemplates and WSShowOnSelect ----- */&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
* Also get the WSShowOnSelect.js file from the ws1 server, it's located in the folder wikis/modules/wsbasics. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;h3&amp;gt;Example&amp;lt;/h3&amp;gt;&lt;br /&gt;
[[{{FULLPAGENAME}}/Example]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h3&amp;gt;Syntax&amp;lt;/h3&amp;gt;&lt;br /&gt;
* You should have an element with class &amp;quot;WSShowOnSelect&amp;quot; around the show on select form-fields and the elements that need to be displayed/hidden.&lt;br /&gt;
* Add class=&amp;quot;hidden&amp;quot; to the elements, so they will not initially be shown&lt;br /&gt;
* Use data-wssos-show to specify which elements should be shown. The value should correspond to the data-wssos-value attribute on the element you want to show&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;div class='WSShowOnSelect'&amp;gt;&lt;br /&gt;
	&amp;lt;!-- Show on select form-field --&amp;gt;&lt;br /&gt;
	&amp;lt;wsfield type=&amp;quot;checkbox&amp;quot; data-wssos-show=&amp;quot;test&amp;quot; /&amp;gt;&lt;br /&gt;
	&lt;br /&gt;
	&amp;lt;!-- element to show/hide --&amp;gt;&lt;br /&gt;
	&amp;lt;div class=&amp;quot;hidden&amp;quot; data-wssos-value='test'&amp;gt;&lt;br /&gt;
		test test&amp;lt;!-- add things you want to show here --&amp;gt;&lt;br /&gt;
	&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Works for the following form-field type:&lt;br /&gt;
* select: add the data-wssos-show attribute to the options))&lt;br /&gt;
* radio&lt;br /&gt;
* checkbox: can have an additional attribute data-wssos-show-unchecked, to specify an element that should be shown when the checkbox is unchecked&lt;br /&gt;
&lt;br /&gt;
Example of checkbox with unchecked&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;WSShowOnSelect&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;wsfield type=&amp;quot;checkbox&amp;quot; data-wssos-show=&amp;quot;test A&amp;quot; data-wssos-show-unchecked=&amp;quot;test B&amp;quot; /&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;hidden&amp;quot; data-wssos-value=&amp;quot;test A&amp;quot;&amp;gt;test checked&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;hidden&amp;quot; data-wssos-value=&amp;quot;test B&amp;quot;&amp;gt;test unchecked&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note that it's possible to have multiple show on select form-fields in the same &amp;quot;WSShowOnSelect&amp;quot; element.&lt;br /&gt;
}}&lt;/div&gt;</summary>
		<author><name>Maintenance script</name></author>
		
	</entry>
</feed>