Thanks, JasonL ! I tried add Javascript to the endpoint, but it wasn't being evaluated and instead output as text. So I went with your first suggestion, posting with ajax from the custom component, but I'm still getting an error.
This is the custom component code, with Ajax POST submit:
Click here to accept ideas terms: I accept ideas term
<@liaAddScript>
;(function($) {
$("form#ideasForm").on("submit",function(e){
var postData = $(this).serializeArray();
var formURL = $(this).attr("action");
console.log('got here 1');
console.log(postData);
console.log(formURL);
e.preventDefault();
$.ajax({
url : formURL,
type: "POST",
data: postData,
success:function(data, textStatus, jqXHR)
{
console.log('got here 2');
window.location('http://website.com');
},
error: function(jqXHR, textStatus, errorThrown)
{
console.log('got here 3', errorThrown);
}
});
e.preventDefault(); //STOP default action
});
//$("form#ideasForm").submit(); //Submit the FORM
})(LITHIUM.jQuery);
Here is the Endpoint code:
<#if user.registered>
<#assign ideas_terms_accepted = http.request.parameters.name.get("ideas_terms_accepted", "false") />
<#if ideas_terms_accepted?? >
${rest("/users/self/profiles/name/ideas_terms_accepted/set?value=${ideas_terms_accepted}")}
Error received: ""Unexpected end of input". I think it's because the endpoint doesn't like the way the data is being passed to it. How does the endpoint want the data passed?