Success!
Here’s what I ended up doing - an interesting mix of technologies, MODx, PHP, javascript and jQuery!
Unfortunately you can’t get at POSTed values via javascript, but you can through PHP, so I created a new SubmitCheck snippet with the following code to check for the presence of the formid value, which is present in every eForm submission:
<?php
$hasPosted = "false";
if (isset($_POST['formid']) && ($_POST['formid']!='') ) {
$hasPosted = "true";
}
return $hasPosted;
?>
I then pulled this info into a javascript variable in my page header so that once the page has loaded and the jQuery dialog initialised it then calls the jquery method to open the dialog if required:
<script type="text/javascript">
var isPosted;
isPosted = [!SubmitCheck!];
$(document).ready(function(){
$("#enquiry").dialog({
bgiframe: true, autoOpen: false ,height: 600, width: 780, modal: true
});
if (isPosted) $("#enquiry").dialog('open');
</script>
Thanks again to PixelChutes for making me think about using javascript to control the display of the dialog. Hope this helps somebody else.
Cheers!