-3

We have PE, and we need to create a VF page. In that page we have created a picklist which has 5 values. When we select a value from the picklist a text box next to that picklist should automatically populate a message similar to that value selected. ie., if our picklist has red, blue, green, when we select "red" then the textbox should populate this message "this is red" likewise. How we can to this? But for PE there is no Apex class how can we achieve this.

  • Is your page visualforce or standard layout? – Mohith Shrivastava May 22 '13 at 3:52
  • 6
    why is that every time you post a question we see no efforts from you, have you worked on something to start with.As a gentel request putin your maximum efforts cook up some basic code, all the members would appriciate your efforts and pour in answers. More efforts gives you better understanding of the subject and will benefit you in a longer run. – Rao May 22 '13 at 5:43
  • 5
    Also you don't appear to have voted up or accepted any of the answers to questions you've raised in the past. If they have been useful to you, acknowledge this so that other people with the same problem can take advantage of the guidance. If you have solved the problem another way, share your work. – Doug B May 22 '13 at 9:30
5

Use jQuery / javascript to populate the field. You could do something like this:

//load the jQuery library
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script>
<script type="text/javascript">
var j$ = jQuery.noConflict();
j$(document).ready(function(){
    //I have assumed the id of the picklist field is pickField and text box is inputTextBox
    j$("[id*=pickField]").change(function(){
         var pickListValue = j$(this).val();
         j$("[id*=inputTextBox]").val('this is '+ pickListValue);
    });
});
</script>

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.