Difficulty on using Creating custom CQ email services example
I get the following error when trying to submit the email form.
Error
"javax.jcr.nodetype.ConstraintViolationException: no matching property definition found for {}name"
while processing /content/.../email2.json.jsp
| Status | 500 |
| Message | javax.jcr.nodetype.ConstraintViolationException: no matching property definition found for {}name |
| Location | /content/.../English/email2.json.jsp![]() |
| Parent Location | /content/.../English |
| Path | /content/.../English/email2.json.jsp |
| Referer | http://localhost:4502/content/.../English/ContactUs.html |
| ChangeLog | <pre></pre> |
Modified Resource
I have set up the following Action for my e-mail page
<form action="email2.json.jsp" method="post" class="ajax">
....
<div class="form__entry">
<input type="submit" value="submit" name="submit" id="submit" value="Submit" class="form__input form__submit" tabindex="7" >
</div>
The Javascript is
$('#contactSubmit').click(function() {
var failure = function(err) {
$(".main").unmask();
alert("Unable to retrive data "+err);
// TODO - clear the form
};
//Get the values to pass to the Mail OSGi bundle
var server = $('#????').val() ; // how to link
var name = $('#name').val() ; // how to link
var surname = $('#surname').val() ;
var email = $('#email').val() ;
var phoneNumber = $('#phoneNumber').val() ;
var enquiry = $('#enquiry').val() ;
var url = location.pathname.replace(".html", "/contactus/email2.json.jsp") + "?to="+ to +"&server="+server +"&subject="+subject +"&message="+message;
$(".main").mask("Sending...");
$.ajax(url, {
dataType: "text",
success: function(rawData, status, xhr) {
try {
$(".main").unmask();
$('input[name"name"]').val('');
$('input[name"surname"]').val('');
$('input[name"email"]').val('');
$('input[name"phoneNumber"]').val('');
$('input[name"enquiry"]').val('');
$('#popup').show();
$('#popup').fadeOut(5000);
} catch(err) {
failure(err);
}
},
error: function(xhr, status, err) {
failure(err);
}
});
return false;
});
});
And I am using a modified version of the email2.jason.jasp