Avatar

Level 10

Hi,

It can be a function, which will make it easier to maintain. Script objects only accept javascript, so you would need to change your script to suit.

The click event would look something like:

yourScriptObject.urlScript(this.rawValue);

Then the script object (yourScriptObject) would contain a function (called urlScript):

function urlScript(fldValue) {

     var vDeleted = Header.currnturl[0].rawValue.substring(64,150) // the second parameter is one greater than the last character you want from the string

     if (Header.currnturl[0].rawValue == null && fldValue == null)

     {

          xfa.host.messageBox("Please paste a valid URL link into the first page", "No URL Link?", 0, 0);

     }

     else if (fldValue == null)

     {

          this.rawValue = vDeleted;

          this.access = "readOnly";

          Rectangle10.assist.toolTip = vDeleted;

     }

     else

     {

          var urljoin = Header.urlstart[0].rawValue.toString() + fldValue;

          xfa.host.gotoURL(urljoin);

     }

} // this is the closing bracket in the function         

You will probably need to adapt / change / test...

Good luck,

N.