How I can add values for first row of empty repeating table by using
jscript?
Button where "add_text" function is attached is outside of table.
Data source:
myFields
group1
group2 (repeating table)
field1
field2
fileld3
Best Regards
Juha
The "[1]" specifies to get the first instance of group2. If you said "[3]" then you would get the 3rd row (if it exists).
If a row might not exist, you can use error checking like such:
var oRow = XDocument.DOM.selectSingleNode("my:myFields/my:group1/my:group2[1]");
if(null != oRow)
{
oRow.selectSingleNode("my:field1").text = "Some Value";
oRow.selectSingleNode("my:field2").text = "Some Other Value";
oRow.selectSingleNode("my:field3").text = "Yet Some Other Value";
}
--
Greg Collins [InfoPath MVP]
Please visit: http://www.InfoPathDev.com
"jp" <juh...@yahoo.com> wrote in message news:4225514c$0$30231$39db...@news.song.fi...