<Script type = "text/javascript">
Function submitfcn (form ){
Var myform = form [0];
Var title = document. getElementById ('Id _ title'). value;
Var content = tinyMCE. getInstanceById ('Id _ content'). getBody (). innerHTML; // obtain the content in tinymce rich text editing.
Var exist = content. match (/\ {name \}/g) & content. match (/\ {url \}/g );
Var done = true;
If (! Title ){
Done = false;
Document. getElementById ('Id _ title'). focus ();
Alert ('Enter the mail title! ');
}
If (! Exist ){
Done = false;
TinyMCE. getInstanceById ('Id _ content'). getBody (). focus ();
Alert ('enter the email content! ');
}
If (done ){
$. Ajax ({
Type: 'post ',
Url: "/emailrecord/sendemaildialog /",
Data: $ (myform). serialize (),
DataType: 'json ',
Success: function (data ){
If (data. result = 1 ){
Alert ('email sent successfully. ');
Location. href = '/progress/summary /';
} Else if (data. result = 0 ){
Alert ('statistics failed! ');
Location. href = '/progress/summary /';
} Else {
Alert ('the email was not sent because you did not select a person or the selected person has completed the questionnaire entry! ');
}
},
Error: function (re, status ){
}
});
} Else {
Return false;
}
}
</Script>
<Table cellspacing = "0" cellpadding = "0" border = "0" class = "display tdBc first_table" width = "100%">
<Caption>
<Span> <strong> email sending {term }}</strong> & nbsp; </span> <a href = "/progress/summary/" style = "float: right;"> return value: & nbsp; </a>
</Caption>
<Tr> <td>
<Fieldset class = "module aligned">
<Div class = "form-row">
<Div>
<Label for = "id_title" class = "required"> email title: </label> <input id = "id_title" type = "text" name = "title" maxlength = "128"/>
</Div>
</Div>
<Div class = "form-row">
<Div>
<Label for = "id_content" class = "required"> email content: </label>
<Textarea id = "id_content" rows = "10" cols = "40" name = "content">
& Lt; br/& gt;
The email content template is as follows: But {name} {url} cannot be changed. It must exist! Delete this row. Thank you & lt; br/& gt;
Dear employee of a company, {name}: & lt; br/& gt;
Log on to the 360 Satisfaction Assessment System ({url}) as soon as possible. log on to the system by clicking the provided link and enter the questionnaire. & Lt; br/& gt;
If you have any questions about the operations on the network platform, contact ma Shentong, & lt; br/& gt;
This email is a system email. Please do not reply! & Lt; br/& gt;
& Lt; label style = "margin-left: 550px;" & gt; Human Resources Department & lt;/label & gt;
</Textarea>
<Script type = "text/javascript">
TinyMCE. init ({
Language: "zh ",
Theme: "advanced ",
Mode: "textareas ",
Theme_advanced_toolbar_location: "top ",
Theme_advanced_toolbar_align: "left ",
Theme_advanced_statusbar_location: "bottom ",
Height: 300, width: 800,
Content_css: "/static/tiny_mce/themes/advanced/skins/default/content.css"
});
</Script>
</Div>
</Div> www.2cto.com
</Fieldset>
<Div>
<Input type = "button" value = "OK" onclick = "submitfcn ($ ('form')"/>
</Div>