You need to sign in to do that
Don't have an account?
Javascript not working properly in apex:outputlink
Hi All,
There is an output link on one page.
When I click on that, it should change style of component to display:none on same page.
For that i have created a javascript function and it is working fine but after chaging the style it simply refresh the page
as I didnt specify value to navigate page.
Below is my logic:
<apex:page>
<script>
function fnCheck(input)
{
alert("script");
document.getElementById(input).style.display = "none";
}
</script>
<apex:form>
<apex:outputLink onclick="fnCheck('{!$Component.testId}');">Test</apex:outputLink>
<apex:inputText id="testId"/>
</apex:form>
</apex:page>
Is there is any way to specify empty value in outputLink or any way to do this?
Thanks.
try using the html anchor tag instead of the apex:outputLink tag.
try using javascript:; in place of value in outputlink tag
<apex:outputLink onclick="fnCheck('{!$Component.testId}');" value="javascript:;">Test</apex:outputLink>
I think that will solve ur problem
(note : is html encoding of the colon value)
Sam