jquery - How can I check if a DNN template editor token is empty or not? -
i have form people can enter information, , each field has token. example if enters name in textbox labeled name, if use [name] token, output entered name on page.
i building page output information entered in form
name: name entered<span>name: </span>[name]
and wondering how can check if token [name] if empty or not, , if field empty, remove element.
thank you
ok - there doesn't seem built-in way conditional formatting on token replacement. there have been thoughts extending token replacement (http://www.dnnsoftware.com/community-blog/cid/154432/templating-or-the-art-of-making-complicated-things-simple), have modify events planner module in order this, , lot of work.
as sort of hack, might suggest following:
<span id="spnnamelabel">name: </span><span id="spnnametext">[name]</span> <script language="javascript"> if (document.getelementbyid("spnnametext").innerhtml == "") { document.getelementbyid("spnnamelabel").style.display = "none"; } </script>
Comments
Post a Comment