Avatar

Level 2

I want to programmatically set the submit button target instead of hard-coding it into the "Submit to URL" field.  This is what I tried:

1) created a separate text field, called submitToURLTxt, with data binding so that it can read the passed-in URL from an XML input file

2) created a submit button and added this code to the docReady event:

var url = submitToURLTxt.rawValue;

if (url == null || url.length == 0) {

   this.presence = "hidden";

}

else {

   this.resolveNode("#event").submit.target = url;

}

I also tried it in formcalc:

if (submitToURLTxt.isNull | submitToURLTxt == "") then

   submitButton.presence = "hidden";

else

  $.event__click.#submit.target = submitToURLTxt.rawValue;

endif

Neither way works. Help?