You need to sign in to do that
Don't have an account?

Needing help with S-control: Showing / hiding fields
Hi,
I'm having a bit of a problem implementing my first S-control. The syntax below is correct but it shows the button whatever. Below is the code I've tried so far:
I tried some code which works for a checkbox which works but I'm trying it for a picklist as above. If the category is "Consultancy" in the picklist, I wish to show the button and hide it in any other circumstances.I don't know if it's anyhting to do with the braces but for some reason the syntax is incorrect if I place an opening brace in front of the !IF saying a } is expected. I have tried just about everything I can thik of to no avail. Can anybody help with this line of code please?
Many thanks
I'm having a bit of a problem implementing my first S-control. The syntax below is correct but it shows the button whatever. Below is the code I've tried so far:
Code:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>Demo Button</title>
<!-- common Salesforce stylesheet --><link href="/sCSS/12.0/Theme2/common.css" type="text/css" media="handheld,print,projection,screen,tty,tv" rel="stylesheet">
</head>
<body style="background-color:#F3F3EC;">
<div style="padding-left: 115px;!IF(NOT(ISPICKVAL( Opportunity.Category__c ,"Consultancy"))),"display: none;"}">
<input value=" Enter Shipping Details " class="btn" name="demo_button" onclick="JavaScript: alert('Thanks for clicking!');" title="Create New Account button" type="button">
</div>
</body>
</html>
I tried some code which works for a checkbox which works but I'm trying it for a picklist as above. If the category is "Consultancy" in the picklist, I wish to show the button and hide it in any other circumstances.I don't know if it's anyhting to do with the braces but for some reason the syntax is incorrect if I place an opening brace in front of the !IF saying a } is expected. I have tried just about everything I can thik of to no avail. Can anybody help with this line of code please?
Many thanks
In this function you check the value of the Opportunity.Category__c field and manipulate the div as required.
e.g
You are a star. Many thanks for that. However, the "Thanks for clicking" message does not appear.
Can you help me a bit further please - it's much appreciated. What I really want is for an editable field or pop-up to appear that the user can fill in with the shipping address and it adds it to the opportunity layout. Sorry for asking a lot!
Many thanks
Scott
What you do with that information (e.g. write it back to salesforce) is up to you.
I want to make some fields hide when a check box is checked in an account. I just can't seem to reverse engineer the code to get it right.
If the condition is True (checked) I want to hide the field Logger_station_Pool.
Any help would be greatly appreciated!
Thanks
This is what I have:
<head>
<script>
function init()
{
if( "{!Account.Is_this_a_Production_or_Show__c}" = "True" )
document.getElementById('Logger_Station_Pool').style.display="block";
}
</script>
</head>
You can install it under: Setup -> App Setup -> Develop -> S-Controls
Are you calling the init() function from somewhere ?
It might be better to make the section default off and enable it if the condition is met.