function copyToClipboard (text) {
window.prompt ("Copy to clipboard: Ctrl+C, Enter", text);
}
The form looks like this:
<table>
<form action="myform.php" method="post" onsubmit="return copytoClipboard()" name="incidentCreator">
<th colspan="2">Incident Creator</th>
<tr>
<td>Email: <input type="text" name="email" value="" /></td>
<td rowspan="9">
</td>
</tr>
<tr>
<td>Name: <input name="name" value=""></td>
</tr>
<tr>
<td>Phone: <input type="text" name="phone" value="" /></td>
</tr>
function copyToClipboard (text) {
window.prompt ("Copy to clipboard: Ctrl+C, Enter", text);
}
Somebody posted this as a solution to copy to the clipboard, but it doesn't show how to use it. I am new to Javascript and am trying to output text from an HTML form into a format as
Can anyone show me an example of how I would take the above form data and present it ready to be copied with this Javascript function?