On submission of a safe form I would like my logged in user to be returned to the previous screen. I picked up the ajax example in the user guide and it works fine but I cannot get the return part to function.
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Directory Entry</title>
{exp:jquery:script_tag}
[removed][removed]
<link href="{path=css/_ee_saef_css}" type="text/css" rel="stylesheet" media="screen" />
[removed]
$(document).ready(function(){
$('#publishForm').ajaxForm({
dataType: 'json',
success: function(data) {
if (data.success) {
alert('You successfully updated your directory entry')
} else {
alert('Failed with the following errors: '+data.errors.join(', '));
}
}
});
});
[removed]
</head>
<body>
<div>
<a href="/login/loginlandingpage">BACK</a>
<h2>Edit your Directory entry here</h2>
<p>{exp:safecracker channel="cats" return="login/loginlandingpage" entry_id="{segment_3}" json="yes" include_jquery="no"}<br />
<label for="title">Business Name</label><br />
<input type="text" name="title" id="title" value="{title}" size="50" maxlength="50"><br />
<label for="web">Your Web Address must be in the form <a href="http://www.mywebsite.com</label>">http://www.mywebsite.com</label></a>;<br />
<input type="text" name="web" id="web" value="{web}" size="50" maxlength="50"><br />
<br />
<input type="submit" name="submit1" value="Submit"><br />
<br />
{/exp:safecracker}<br />
</div><br />
</body><br />
</html>