Here is my problem:
I have a hidden text field that contains text from an xml
<facilities>
<building>
<name>Building A</name>
<name>Building B</name>
<name>Building C</name>
<name>Building D</name>
<name>Building E</name>
<name>Building F</name>
<name>Building G</name>
<name>Building H</name>
</building>
</facilities>
My goal is to read this xml string with JavaScript to populate a drop down with the element(name) values. Does anyone know how to script that?
Attached is a sample .xdp
Cheers,
Jesse
Solved! Go to Solution.
Views
Replies
Total Likes
Here is a modified sample. I put the code on the button click so you can see it in operation .....you can put that code on the event that makes sense for you. I also added another field for showing the DOM (this is for debug purposes and you can remove this field if you want).
Paul
Views
Replies
Total Likes
It looks like the BBS is messing up zip files ....can you re-post it but save it as a PDF file ..or rename the extension to xxx
Paul
Ooops. Try this one.
Views
Replies
Total Likes
Still didn't work.
Here is a PDF.
Jesse
Views
Replies
Total Likes
Here is a modified sample. I put the code on the button click so you can see it in operation .....you can put that code on the event that makes sense for you. I also added another field for showing the DOM (this is for debug purposes and you can remove this field if you want).
Paul
Views
Replies
Total Likes
Thank you so much! I've spent hours trying to figure this out. Much appreciated!!!
Views
Replies
Total Likes
Ok, here is another issue. I'm getting the xml back from a web service and
the xml format is different from the example I provided (not as clean).
It appears that it is only taking the value of one node. Is there a way to make this work via script?
PDF is attached.
Thanks,
Jesse
Views
Replies
Total Likes
Here is a modified sample .....I changed the for loop as well as the debug step to show the structure of the xml that is being loaded. Then you can see how the nodes.item is achieved.
Paul
Ahhh, I see now. Thank you so much, again!
Jesse
Views
Replies
Total Likes
The text field in my example is data from a web service. Is there a way to "clear out" the data dom to allow new/different data from the web service?
I noticed that when try to add new xml data to the dom, it combines it with the old xml. I'm looking for a way to clear the dom and add new data.
Does this make sense?
Thanks,
Jesse
Views
Replies
Total Likes
You may want to try the command xfa.host.resetData();
This will reset the entire form back to its original state. If you only want to reset specific fields, you can name them sperated by comas in between the round braces.
Paul
Views
Replies
Total Likes
Jesse,
Were you able to fix the issue of clearing the DOM and add new data with the XML from webservice?? I am getting the similar issue and looking for a solution..
Does anyone has any ideas how to fix this?
Thanks
Srini
************************* Your old post Begin *******************
The text field in my example is data from a web service. Is there a way to "clear out" the data dom to allow new/different data from the web service?
I noticed that when try to add new xml data to the dom, it combines it with the old xml. I'm looking for a way to clear the dom and add new data.
Does this make sense?
Thanks,
Jesse
************************* Your old post End *******************
Views
Replies
Total Likes
Srini,
Did you try the example from the above thread?
"You may want to try the command xfa.host.resetData();
Thiswill reset the entire form back to its original state. If you only wantto reset specific fields, you can name them sperated by comas inbetween the round braces."
I did try the first command to reset the entire form and it worked.
Jesse
Views
Replies
Total Likes
Views
Likes
Replies