Jump to content
  • 0

Adding Conditional To Html Block


Millie

Question

One of the Caspio techs wrote me a small script for a search-within-search, which works quite well. However, I now only want it to show for some records, so I added a Yes/No field named "more".

 

I'm trying to get the if/then to work, but now it always hides my search (basically, defaulting to "no", even when I have "yes" checked).

 

Here is the full script (the lines in bold are what I've added as my conditional):

 

<script>

if (document.getElementById('more').checked){

 

<BLOCKQUOTE>

Click <a href="http://b5.caspio.com/dp.asp?AppKey=942730000c5a08516e2a40b0a4bf&EN_ID=[@field:EN_ID]">here </a> to view related articles.

}

</script>

 

I also tried this, with the same result:

 

<script>

if ('[@field:more]'=='yes')

{

<BLOCKQUOTE>

Click <a href="http://b5.caspio.com/dp.asp?AppKey=942730000c5a08516e2a40b0a4bf&EN_ID=[@field:EN_ID]">here </a> to view related articles.

}

</script>

 

I don't have any experience with Javascripting. Could someone please tell me what I'm doing wrong?

 

: ) Millie

Link to comment
Share on other sites

3 answers to this question

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.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...