• MK B. Fleming
  • NEWBIE
  • 0 Points
  • Member since 2011

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 0
    Questions
  • 2
    Replies

Hi,

 

I'm trying to find a solution to hide a text box is a checkbox is checked. This is very similar to the dependent field relationships for picklists, but that feature isn't active for other field types. I thought I could build this using the following javascript, but no such luck. Whenever I try to create a new record, I can still see the dependent text field whether the checkbox is checked or not. Strangely, my syntax gives me no errors (it just doesn't do anything).

 

Here's my code:

 

<script>
<!--
function c(){}


function test(){
if({!Product2.Royalty__c}.checked){
{!Product2.Royalty_Vendors__c}.style.visibility="visible"
}
else{
{!Product2.Royalty_Vendors__c}.style.visibility="hidden"
}
}
//-->
</script>

  • February 06, 2009
  • Like
  • 0