Skip to content

Instantly share code, notes, and snippets.

@totango
Created March 2, 2012 10:08
Show Gist options
  • Save totango/1957493 to your computer and use it in GitHub Desktop.
Save totango/1957493 to your computer and use it in GitHub Desktop.
New appbox message form
<h2>Send Message Form<small>Use the form below to send message</small></h2>
<!-- Put the message_editor just below -->
<form id="appbox_form" action='javascript:true;' method='post' class="well">
<fieldset>
<label>Receiver Name: </label><input type='text' name='receiver_name'>
<label>Receiver ID:</label><input type='text' name='receiver_id' value="test-user@email.com"'></input>
<label>Sender Name:</label><input type='text' name='sender_name'></input>
<label>Sender ID:</label><input type='text' name='sender_id'></input>
<label>Subject:</label><input type='text' name='subject'></input>
<label>Content:</label><textarea name='content'></textarea>
<label></label><input type='submit' value='create message'></input>
<input type='hidden' name='type' value='info'></input>
<input type='hidden' name='status' value='unread'></input>
<!-- Get the appbox app_id and token from http://www.appbox.com -->
<input type='hidden' name='app_id' value="${replace with your provided app_id}"></input>
<input type='hidden' name='secret' value="${replace with your provided secret key}"></input>
</fieldset>
</form>
<!-- -->
<script type="text/javascript">
$("#appbox_form").submit(function() {
$.post("//www.appboxjs.com/api/v1/appbox/new_message/", $("#appbox_form").serializeArray(),
function(data) {
});
return false;
});</script>
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment