• Nigel Fisher 26
  • NEWBIE
  • 0 Points
  • Member since 2020

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

I know this is a really basic question but I am just gettign started.

I have the code but the inout box is not getting populated.

It would be really helpful if someone could pont me in the right direction.

I am hoping to do this wothout an apex class
 
<apex:page standardController="Lead" doctype="html-5.0">

    <head>
        
  <body>
      
      
   <apex:form id="form1">
    <apex:selectList multiselect="false" size="1" id="selectedCountry" onselect="SelectAPICountry()">

         <apex:selectOption itemValue="ie" itemLabel="Ireland"/>
         <apex:selectOption itemValue="gb" itemLabel="Northern Ireland"/>
         <apex:selectOption itemValue="ni" itemLabel="Great Britain"/>
      </apex:selectList>
        <apex:input size="20" label="country id" id="countryid"/>
    </apex:form> 

  
   <script type="text/javascript">
function SelectAPICountry() {
                document.getElementById('{!$Component.form1.countryid}').value = document.getElementById('{!$Component.form1.selectedCountry}').value;
            }

</script>
          </body>
</head>
          
    </apex:page>
Much appreciated 
 
Hi

I know this is a really basic question but I am just gettign started.

I have the code but the inout box is not getting populated.

It would be really helpful if someone could pont me in the right direction.

I am hoping to do this wothout an apex class
 
<apex:page standardController="Lead" doctype="html-5.0">

    <head>
        
  <body>
      
      
   <apex:form id="form1">
    <apex:selectList multiselect="false" size="1" id="selectedCountry" onselect="SelectAPICountry()">

         <apex:selectOption itemValue="ie" itemLabel="Ireland"/>
         <apex:selectOption itemValue="gb" itemLabel="Northern Ireland"/>
         <apex:selectOption itemValue="ni" itemLabel="Great Britain"/>
      </apex:selectList>
        <apex:input size="20" label="country id" id="countryid"/>
    </apex:form> 

  
   <script type="text/javascript">
function SelectAPICountry() {
                document.getElementById('{!$Component.form1.countryid}').value = document.getElementById('{!$Component.form1.selectedCountry}').value;
            }

</script>
          </body>
</head>
          
    </apex:page>
Much appreciated