Making field visible in HTML Print format conditionally

I'd like to have a warning message show up in an HTML print format based on the value of *another* field. 

Specifically, I have a check type (binary) field which I'll call "A".  if user sets the value of field A to 1, then the second field of type HTML should show up in print form.  Is this something that needs to be edited in the print format's HTML?  I hope someone can help by pointing me in the right direction. Tjhanks!



Note:

 

If you are posting an issue,

  1. We should be able to replicate it at our end. So please give us as much information as you can. Please see it from the point of view of the person receiving the communication.
  2. Paste your code at http://pastebin.com or http://gist.github.com and send only the URL via email
  3. For sending images, use http://imgur.com or other similar services. Do not send images as attachments. Links are good. Same goes for any file you are going to send.

     

    End of Note



    You received this message because you are subscribed to the Google Groups “ERPNext Developer Forum” group.

    To unsubscribe from this group and stop receiving emails from it, send an email to erpnext-developer-forum+un...@googlegroups.com.

    For more options, visit https://groups.google.com/groups/opt_out.
Put it in a script tag,

<script>doc.check===1 ? "This" : "That"</script>


On Saturday, January 25, 2014 2:42:33 PM UTC+5:30, lxnow wrote:
I'd like to have a warning message show up in an HTML print format based on the value of *another* field. 

Specifically, I have a check type (binary) field which I'll call "A".  if user sets the value of field A to 1, then the second field of type HTML should show up in print form.  Is this something that needs to be edited in the print format's HTML?  I hope someone can help by pointing me in the right direction. Tjhanks!



Note:

 

If you are posting an issue,

  1. We should be able to replicate it at our end. So please give us as much information as you can. Please see it from the point of view of the person receiving the communication.
  2. Paste your code at http://pastebin.com or http://gist.github.com and send only the URL via email
  3. For sending images, use http://imgur.com or other similar services. Do not send images as attachments. Links are good. Same goes for any file you are going to send.

     

    End of Note



    You received this message because you are subscribed to the Google Groups “ERPNext Developer Forum” group.

    To unsubscribe from this group and stop receiving emails from it, send an email to erpnext-developer-forum+un...@googlegroups.com.

    For more options, visit https://groups.google.com/groups/opt_out.
Thanks, and to correct the typo for future users:

<script>doc.fieldname==1 ? "ThisMessageIfChecked" : "ThisMessageIfNotChecked"</script>

On Sunday, January 26, 2014 4:08:00 PM UTC+8, rushabh wrote:
Put it in a script tag,




On Saturday, January 25, 2014 2:42:33 PM UTC+5:30, lxnow wrote:
I'd like to have a warning message show up in an HTML print format based on the value of *another* field. 

Specifically, I have a check type (binary) field which I'll call "A".  if user sets the value of field A to 1, then the second field of type HTML should show up in print form.  Is this something that needs to be edited in the print format's HTML?  I hope someone can help by pointing me in the right direction. Tjhanks!



Note:

 

If you are posting an issue,

  1. We should be able to replicate it at our end. So please give us as much information as you can. Please see it from the point of view of the person receiving the communication.
  2. Paste your code at http://pastebin.com or http://gist.github.com and send only the URL via email
  3. For sending images, use http://imgur.com or other similar services. Do not send images as attachments. Links are good. Same goes for any file you are going to send.

     

    End of Note



    You received this message because you are subscribed to the Google Groups “ERPNext Developer Forum” group.

    To unsubscribe from this group and stop receiving emails from it, send an email to erpnext-developer-forum+un...@googlegroups.com.

    For more options, visit https://groups.google.com/groups/opt_out.