You need to sign in to do that
Don't have an account?
Java Script with output panel
Hello,
I just want to show or hide the output panel "flight" on chaging the value of drop dwon box .
my code is
<apex:page showHeader="false" standardController="travel_booking__c" extensions="travel">
<html><br></br><br></br>
<head> <b><big><center> <font face="Times New Roman" size="+3" color="#ff0000">Capgemini Travel Desk</font></center></big></b></head>
<br></br><br></br>
<apex:form id="f1" rendered="true">
<apex:pageBlock id="block" >
<apex:pageBlockSection title="Login" id="pageblock" >
<apex:outputtext value="Corp ID"/>
<apex:outputtext value="Name"/>
<apex:outputtext value="Project Name"/>
<apex:outputtext value="Manager"/>
<apex:inputField id="piclist" value="{!travel_booking__c.Travel_type__c}" onchange="changevalue(document.getElementById('{!$Component.piclist}'));" />
<br></br>
<apex:outputText value="*This site is powered by Megha Travel agency"/>
<br></br>
<apex:outputPanel id="flight" rendered="false">
<apex:outputText value="From Country" />
<apex:inputField value="{!travel_booking__c.Fromcountry__c}"/>
<apex:outputText value="To Country" />
<apex:inputField value="{!travel_booking__c.To_Country__c}"/>
</apex:outputPanel>
<apex:outputPanel layout="block" id="train" rendered="false">
<apex:outputText id="test" value="From City" />
<apex:inputField value="{!travel_booking__c.From_City__c}"/>
<apex:outputText value="To City" />
<apex:inputField value="{!travel_booking__c.To_City__c}"/>
</apex:outputPanel>
</apex:pageBlockSection>
<script type="text/javascript">
function changevalue(txt)
{
if(txt.value=="Flight (International)")
{
document.getElementById('{!$Component.block.pageblock.flight}').innerHTML.style.visibility ='visible';
}
}
</script>
</apex:pageBlock>
</apex:form>
</html>
</apex:page>
Moreover plz tell me how to implement this with actionfunction
ActionFunction version:
Page
Extension:
HTH
All Answers
Sorry, to clarify - are you looking to replace that code with just ActionFunction functionality or is that code not working as expected?
Actually I am looking for both the things
1.how to use Action function instead of using my code
2.My this code is also not working
OK, here's a working example of doing this with JavaScript.
Will post an actionFunction version as well.
ActionFunction version:
Page
Extension:
HTH
Thanks , for your support ..now I come to know what mistake I was doing