I'm trying to pop up a dialog containing a text area for the email content.
This code pops up the dialog when the first button is clicked, but I'm having no luck getting the "send email" button to do anything.
<body>
<button id="myButton">Click for the dialog!</button>
</body>
<div id="myDialog" title="Reply">
<textarea id="myTextarea">Some initial text</textarea>
<button id="emaiSubmit" onclick="emailButtonClicked()">Send Email</button>
</div>
JS:
function emailButtonClicked() {
alert('Clicked');
}
$("#myDialog").dialog({
autoOpen: false
});
$("#myButton").button().click(function() {
$("#myDialog").dialog("open");
});
Ultimately, I'd like to capture the textarea's final text, close the dialog, and send the email with Ajax. But the first step is to get the "Send Email" button to execute some code.