I am trying to get the member’s notepad to display in a public template. This works fine, actually:
<?php global $SESS; ?>
{exp:query sql="SELECT notepad, notepad_size FROM exp_members
WHERE member_id = '<?=$SESS->userdata['member_id'];?>'"}
<form method="post" action="{path=member/update_notepad}">
<input type="hidden" name="notepad_size" value="{notepad_size}" />
<textarea name="notepad" rows="{notepad_size}" cols="120">{notepad}</textarea>
<input type="submit" value="Update" />
</form>
{/exp:query}
If they change anything and hit “Submit”, however, they are taken to the members templates. I’d rather they stayed on the site, such as with the notepad in the control panel. I’d need no visual feedback, either. How could I accomplish that easily? Some AJAX?
I suppose I could simply write the {notepad} back to the db with an UPDATE query, but I feel there must be a simpler way.
