Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
webOS PhoneGap Support Example
<!DOCTYPE html>
<!--
This is an example of using form fields in PhoneGap to compose an email message. More details are available in this blog post:
http://weboscapades.blogspot.com/2011/08/we-all-need-little-support.html
Ken Schreihofer
weboscapades.blogspot.com
-->
<html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>webOScapades PhoneGap Support App</title>
<script type="text/javascript" src="phonegap-1.0.0.js"></script>
<script type="text/javascript">
function onLoad() {
navigator.device.deviceReady();
}
function formSubmit(){
var datestamp=new Date();
var title= "Support Request from "+ document.getElementById('name').value;
var text_cont="Name: "+document.getElementById('name').value+"<br/>E-mail Address: "+document.getElementById('add').value+"<br />Timestamp: "+datestamp+"<br />Problem: "+document.getElementById('problem').value;
try {
this.service = navigator.service.Request('palm://com.palm.applicationManager', {
method: 'launch',
parameters: {
id: "com.palm.app.email",
params: {
summary: title,
text: text_cont,
recipients: [{
type:"email",
role:1,
value:"johnsmith@example.com",
contactDisplay:"John Smith"
}]
}
}
});
}
catch(ex) {console.log("error");}
}
</script>
</head>
<body onload="onLoad();">
<h2 align="center">Support Request</h2>
<h3 align="center">Help us help you!</h3>
<p align="center">Please fill out the below form to contact support.</p>
<form align="center" name="oForm">
<table>
<tbody>
<tr><td align="right">Name:</td>
<td><input type="text" name="name" id="name" /></td></tr>
<tr><td align="right">E-mail:</td>
<td><input type="text" name="add" id="add" /></td></tr>
<tr><td align="right">Problem:</td>
<td><textarea rows="5" cols="22" name="problem" id="problem"></textarea></td></tr>
</tbody>
</table>
<input type="button" onclick="formSubmit()" value="Submit form" align="center"/>
</form>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment