Add the following function to the code for your form:
---
function getTextChunk(origText, startPos, chunkLength)
{
if (origText.length >= startPos + chunkLength) {
return origText.substr(startPos, chunkLength);
} else {
return origText.substr(startPos);
}
}
---
Then use it as follows:
---
var longText = XDocument.DOM.selectSingleNode("//my:notes").text;
var chunkLength = 255;
XDocument.DOM.selectSingleNode("//my:field1").text = getTextChunk(longText,
0, chunkLength);
XDocument.DOM.selectSingleNode("//my:field2").text = getTextChunk(longText,
chunkLength, chunkLength);
XDocument.DOM.selectSingleNode("//my:field3").text = getTextChunk(longText,
2*chunkLength, chunkLength);
XDocument.DOM.selectSingleNode("//my:field4").text = getTextChunk(longText,
3*chunkLength, chunkLength);
---
S.Y.M. Wong-A-Ton
> Hello,
>
[quoted text clipped - 4 lines]
> chunk into another field? So the end result would be 4 text boxes containing
> 255 characters each instead of one containing 1000.
Colin - 03 Feb 2006 14:35 GMT
That works GREAT! Thank you very very much.
> Add the following function to the code for your form:
>
[quoted text clipped - 35 lines]
> > chunk into another field? So the end result would be 4 text boxes containing
> > 255 characters each instead of one containing 1000.