Forum for discussing general topics related to Couch.
3 posts Page 1 of 1
Hello! I trying to figure out how to fix a problem for me, that I want to fix.

I have made a form with databound.
Exempel:
Name,
Last name,
Skype..


Right now I have a image for skype that show always, if I haven't write/or writed in the input, it always gonna show the Image.

But I trying to do so, when i'm not have writed in the "Skype Input" is not gonna show the image, and when I write in the Skype Input, it's gonna show the skype icon when I submit it.

I don't have any experice about programming, but I quess I can use the <cms:if> & else ?

Hope someone understand what I mean.

Code: Select all
  <label>Skype Account</label>
    <cms:input name="skype" type="bound" placeholder="Your Skype account name..." />


Code: Select all
   <cms:if "<cms:not submit_success />" >
        <button type="submit">Submit now</button>
    </cms:if>


Code: Select all
  <div id="SkypeButton_Call_<cms:show skype />_1" class="javascriptskype">
     <script type="text/javascript">
     Skype.ui({
     "name": "chat",
     "element": "SkypeButton_Call_<cms:show skype />_1",
     "participants": ["<cms:show skype />"]
     });
     </script>
  </div>
I got a little bit confused about some of the exact details, so sorry if this doesn't do exactly what you want.
Is this what you're looking for?
Code: Select all
<cms:if skype>
<div id="SkypeButton_Call_<cms:show skype />_1" class="javascriptskype">
     <script type="text/javascript">
     Skype.ui({
     "name": "chat",
     "element": "SkypeButton_Call_<cms:show skype />_1",
     "participants": ["<cms:show skype />"]
     });
     </script>
</div>
</cms:if>

Or you can use cms:if to apply a class that will hide the image.
Code: Select all
.hide{display:none;}

<div id="SkypeButton_Call_<cms:show skype />_1" class="javascriptskype<cms:if skype == ""> hide</cms:if>">
<script type="text/javascript">
Skype.ui({
"name": "chat",
"element": "SkypeButton_Call_<cms:show skype />_1",
"participants": ["<cms:show skype />"]
});
</script>
</div>

Does that help?
tim wrote: I got a little bit confused about some of the exact details, so sorry if this doesn't do exactly what you want.
Is this what you're looking for?
Code: Select all
<cms:if skype>
<div id="SkypeButton_Call_<cms:show skype />_1" class="javascriptskype">
     <script type="text/javascript">
     Skype.ui({
     "name": "chat",
     "element": "SkypeButton_Call_<cms:show skype />_1",
     "participants": ["<cms:show skype />"]
     });
     </script>
</div>
</cms:if>

Or you can use cms:if to apply a class that will hide the image.
Code: Select all
.hide{display:none;}

<div id="SkypeButton_Call_<cms:show skype />_1" class="javascriptskype<cms:if skype == ""> hide</cms:if>">
<script type="text/javascript">
Skype.ui({
"name": "chat",
"element": "SkypeButton_Call_<cms:show skype />_1",
"participants": ["<cms:show skype />"]
});
</script>
</div>

Does that help?



Ohh was it that easy? just write <cms:if skype>

I did think I need to write many things to make that thing, now is it working thanks!
3 posts Page 1 of 1
cron