Substr JScript - InfoPath Dev Sign in | Join | Help in Code InfoPath (Entire Site) InfoPath Dev InfoPath Dev is dedicated to bringing you the information and tools you need to be successful in your Microsoft Office InfoPath development projects. Home Blogs Forums Photos Downloads InfoPath Dev » InfoPath » Code » Substr JScript Substr JScript Last post 12-14-2006 07:43 AM by Matt Faus. 3 replies. Page 1 of 1 (4 items) Sort Posts: Oldest to newest Newest to oldest Previous Next 12-08-2006 01:29 AM diaboloche Joined on 10-03-2006 Posts 116 Substr JScript Reply Contact Hi, sorry for my bad english...my problem is : var date = XDocument.DOM.selectSingleNode("//my:date1"); var annee = date.substr(0, 4);the error is :Object doesn't support this property or methodI don't understand...Help please...Thanks ! 12-08-2006 01:45 AM In reply to Patrick Halstead Joined on 08-08-2006 Posts 5,112 Re: Substr JScript Mark as Not AnswerMark as Answer... Reply Contact Hi Diabloche,Date isn't a string. You need a date.TextNode.substr or something like that (I forget the string object underneath but Intellisense should remember for you). Patrick HalsteadProject Manager at Qdabra 12-08-2006 02:30 AM In reply to diaboloche Joined on 10-03-2006 Posts 116 Re: Substr JScript Mark as Not AnswerMark as Answer... Reply Contact Thanks for your reply,I work in the script editor, i don't have an intellisenseXDocument.UI.Alert(XDocument.DOM.selectSingleNode("//my:date1").TextNode);Why the string is empty ? I don't understand... does not post anything... 12-14-2006 07:43 AM In reply to Matt Faus Joined on 08-18-2006 Dallas, Texas Posts 1,558 Re: Substr JScript Mark as Not AnswerMark as Answer... Reply Contact Hi diabolche,Try this:var date = XDocument.DOM.selectSingleNode("//my:date1").text; var annee = date.substring(0, 4);http://msdn2.microsoft.com/en-gb/library/3cz15ahb.aspxI feel your pain on working in script editor without Intellisense - oh the agony! Matt Faus / Microsoft InfoPath MVPQdabra® Software / Streamline data gathering to turn process into knowledge Page 1 of 1 (4 items) Copyright © 2003-2019 Qdabra Software. All rights reserved.View our Terms of Use.
var date = XDocument.DOM.selectSingleNode("//my:date1"); var annee = date.substr(0, 4);
XDocument.UI.Alert(XDocument.DOM.selectSingleNode("//my:date1").TextNode);