locked
How to assign text box value to Picklist? RRS feed

  • Question

  • Hi ,

    how to assign text box value(Text) to Picklist.

    for example i have a picklist that shows all the countries.

    in text box i enterd country name "India".

    so this text box text i need to assign to Pickist .and Pick list already having India.

    this just i want to set the value

     

    thanks

     

    Tuesday, February 1, 2011 6:06 AM

Answers

  • You'll need to iterate through the picklist options; something like:

    var text = crmForm.all.textattribute.DataValue;
    var picklist = crmForm.all.picklistattribute;
    
    for (var i = 0; i < picklist.Options.length; i++) {
     if (picklist.Options[i].Text == text) {
      picklist.DataValue = picklist.Options[i].DataValue;
     }
    }
    

    --pogo (pat)
    Tuesday, February 1, 2011 6:40 AM