none
InfoPath 2007/2010: Manually fill dropdown list by JScript RRS feed

  • Question

  • Dear MSDN,

    I would like to manually fill a dropdown list inside my InfoPath template by using JScript code. I have searched everywhere on the web but I can not find any solution. I have managed to get it as far as this:

    var cbDep = XDocument.DOM.selectSingleNode("my:Fields/my:Department");
    
    var node = cbDep.cloneNode(true);
    
    node.text = "test";
    
    cbDep.appendChild(node);
    

    But this will result in the follwing error:

    "Element '{http://schemas.microsoft.com/office/infopath/2003/myXSD/2006-09-26T13:33:18}Department' is unexpected according to content model of parent element '
    http://schemas.microsoft.com/office/infopath/2003/myXSD/2006-09-26T13:33:18}Department'.

    Can someone help me out? this can not be that hard right?

    Kind reqards,

    Mike

    Friday, January 6, 2012 12:39 PM

Answers

  • Hello Mike,
     
    Thanks for posting. Actually, in this forum, there are also few experts on Infopath programming issues. To get more help about Infopath programming issues, I recommend you could try to ask in Answer site. Although that answer site is for end-user issues, you will also find more Infopath specialists on programing issues. 

    http://answers.microsoft.com/en-us/office/forum/office_2007-infopath 

    However, please have a look at this kb article to see whether it can help you:

    http://support.microsoft.com/kb/826994
     
    If you have any concern on this post, just feel free to follow up. Thanks for your understanding. Have a nice day.

    Best Regards,


    Bruce Song [MSFT]
    MSDN Community Support | Feedback to us
    • Edited by Bruce Song Monday, January 9, 2012 9:30 AM
    • Marked as answer by Bruce Song Wednesday, January 18, 2012 6:05 AM
    Monday, January 9, 2012 9:30 AM