add/delete items in drop-down list with jscript? - InfoPath Dev
in

InfoPath Dev

add/delete items in drop-down list with jscript?

Last post 12-02-2006 04:56 AM by TTS. 2 replies.
Page 1 of 1 (3 items)
Sort Posts: Previous Next
  • 11-25-2006 04:15 PM

    • TTS
    • Not Ranked
    • Joined on 11-22-2006
    • Posts 9

    add/delete items in drop-down list with jscript?

    I've made a form with 1 drop-down list populated from Access database. Can I add or delete items using jscript?
    I tried to delete an item with removeChild function, but it says that I cannot remove node of type ATTRIBUTE.
  • 11-27-2006 09:54 AM In reply to

    Re: add/delete items in drop-down list with jscript?

    The Access database should have returned a repeating node-set. Whether there are attributes involved should be irrelevant because it is the elements that you want to remove.

    You are on the right track, it sounds like you are just attempting to remove the incorrect node. If you are trying to remove an attribute now, maybe all you need to do is move up to the attribute's parent element and remove that. Just make sure you are removing the repeating node itself, not one of its descendant nodes.

    As for inserting, you need to get a copy of that same repeating node, fill in or clear values as appropriate, and then insert it into the appropriate place using appendChild or insertBefore.
  • 12-02-2006 04:56 AM In reply to

    • TTS
    • Not Ranked
    • Joined on 11-22-2006
    • Posts 9

    Re: add/delete items in drop-down list with jscript?

    Thank you. I'll try it.
Page 1 of 1 (3 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.