Quantcast
Channel: ASPRunner forums
Viewing all articles
Browse latest Browse all 2586

Edit Page Dialog issues

$
0
0
Hey Everyone,
I'm having an issue with the code below not executing when on an Edit page. The purpose of the button code is to create a pdf of the document they are on and send it to the email in the system. I have also tested doing just a Runner.PDF.download option and I get the same error. Any assistance/guidance would be greatly appreaciated.

ERROR:
Uncaught TypeError: Cannot read property 'replace' of undefined
at Object.Runner.displayGenericAjaxError (RunnerAll.js?36520:204)
at Object.success (RunnerAll.js?36520:2925)
at j (loadfirst.js?36520:1)
at Object.fireWith [as resolveWith] (loadfirst.js?36520:1)
at x (loadfirst.js?36520:1)
at XMLHttpRequest.b (loadfirst.js?36520:1)

CLIENT BEFORE
var emailCtrl = Runner.getControl(pageid,'client_Email'); 
params['email'] = emailCtrl.getValue();
params['filename'] = "PhotographyAgreement.pdf";


ajax.addPDF('pdf',{});
return false;


SERVER
$path = $button->saveTempFile( $params["pdf"] );
$result["emailaddy"] = $params["email"];
$mail = array();
$mail["to"] = $params["email"];
$mail["subject"] = "PHPRunner PDF and Email demo";
$mail["body"] = "Check the results";
$attachment = array(
   "path" => $path,
"name" => $params["filename"]
);
$mail["attachments"] = array( $attachment );
 
$ret = runner_mail( $mail );
 
if( $ret["mailed"] ) 
{
   $result["success"] = true;
}
else
{
   $result["message"] = $ret["message"];
$result["success"] = false;
}




CLIENT AFTER


if( result.success ) {
	$("#saveButton1").click();
   ctrl.setMessage("sent ok");

} else {
   ctrl.setMessage("error sending " + result.message );
}

Viewing all articles
Browse latest Browse all 2586

Trending Articles