I want to add both static text and a property to a text area. For example I want to display " [Development x] started work on [Start Date]" where Development_Name() and Start_Date() are properties that store the name and date respectively
This is what the text area looks like and the Development_Name() property works fine
<text area rows="6" class="textarea-box" id="txtComments" data-bind="Development_Name()"
How do I append static text to this. Doing it this way (below) is obviously incorrect
textarea rows="6" class="textarea-box" id="txtComments" data-bind="Development_Name()'+Started work on+'Start_Date()"></textarea>
Any suggestions
Creating a method in the .js file and adding a data-bind value to it solves the problem.
Here's the view
<textarea rows="6" class="textarea-box" id="txtComments" data-bind="value: EmailBodyText"></textarea>
This is what the view model will look like
SendEmail: function () {
if (FlagResult() == "EI") {
// $("#rowWrapParticipation").addClass('alert alert-danger');
EmailBodyText("There was an attempt by your company to enter " + SponsorName() + "-" + $("#ddlDevelopment option:selected").text() + ". Unfortunately, at this time, you do not meet the controlled insurance program requirements to come onto the project site. Please contact Rebecca Osborne at Consolidated Risk Solutions via 678.893.7483 or rebecca.osborne@c-r-solutions.com to address this issue");
}
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.