I know that this is question has been asked many times before but I can't find any similar case like mine.
I want to call a javascript function on an input type button control I'm doing it like so:
<input type="button" onclick="FormatApplicationMessage(@application.StatusID, '@application.IssueMessage')" class="fa fa-search fa-lg" />
but I always got this error:
Uncaught SyntaxError: Unexpected token ILLEGAL
This is the generated html :
<input type="button" onclick="FormatApplicationMessage(5, 'Please provide a copy of your CV')" class="fa fa-search fa-lg" />
I tried to do this:
<input type="button" onclick='FormatApplicationMessage(@application.StatusID, "@application.IssueMessage")' class="fa fa-search fa-lg" />
But I get the same error message
any hacks ?
EDIT
Here is FormatApplicationMessage
implementation:
function FormatApplicationMessage(statusID, issueMsg) {
//declined
if (statusID == 4) {
$('#ApplicationMessageLabel').val("Message");
}
//Update Required
else if (statusID == 5) {
$('#ApplicationMessageLabel').val("Message");
}
//Approved
else if (statusID == 6) {
$('#ApplicationMessageLabel').val("Message");
}
$('#ApplicationMessage').show();
}