Translation of a vbscript-code to jscript - InfoPath Dev
in

InfoPath Dev

Translation of a vbscript-code to jscript

Last post 09-21-2011 03:00 AM by dchrist1. 0 replies.
Page 1 of 1 (1 items)
Sort Posts: Previous Next
  • 09-21-2011 03:00 AM

    Translation of a vbscript-code to jscript

    Hey everybody,

    first of all. I'm a german guy and if I have some mistakes in my sentences: Sorry for that. I have the following code from an existing form:

    Sub XDocument_OnLoad(eventObj)
    strPath = XDocument.URI
    strFileName = Right (strPath, Len(strPath) - InStrRev(strPath, "/"))
    strFileName = Left(strFileName, Len(strFileName) - 4)

    dim oInfo set oInfo = XDocument.DOM.selectSingleNode("/my:meineFelder/my:ID")
    oInfo.text = strFileName
    End Sub

     And now I must change the code language to jscript and I already tried to do that:

    function XDocument::OnLoad(eventObj)
    {
    var strPath = XDocument.URI;
    var strFileName  = ...
    strFileName =...

    var oInfo = XDocument.DOM.selectSingleNode("/my:meineFelder/my:ID");
    oInfo.text = strPath;
    }

    As you can see on my attempt, I don't know how to translate the lines "strFileName = ...". Could someone of you maybe help me?

     

    best regards
    Daniel

Page 1 of 1 (1 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.