meteor - How to check a variable value within a template -


problem : want show different templates based on user selection.

question : there way check radio button selected using markup(spacebars) , not using click event on radio button value. following example of want do.

<template name="category">   <label class="radio-inline">     <input name="studentgroup" id="studentyes" value="true" type="radio"> yes   </label>   <label class="radio-inline">     <input name="studentgroup" id="studentno" value="false" type="radio"> no   </label> </template> 

within conditional block want check radio button selected can show correct template.

{{#if value}}    {{> studenttemplate}} {{else}}    {{> regulartemplate}} {{/if}} 

the way use click event value. there might community packages automate you, though.


Comments

Popular posts from this blog

Prolog - Listing -

python - can't seem to get an output from my class -

orchardcms - change base url in local copy in Orchard CMS -