I need to make a POST request to a third party site from the Client browser rather than the server. This is so that the third party can receive some data and then place a cookie in the client browser to avoid some repetitive authentication.
The requirement is quite basic - I want to make a POST to a url with a parameter which consists of three data items, which would be a json encoded string.
I also noticed that the HTML (Render Form) Action has some options that could be relevant in this case, and perhaps there is a way to achieve what I want from there. Is there any tutorial which will help me to understand how to use the options in this Action?
ChronoForms technical support
If you'd like to buy me a coffee or two, thank you very much
I have now a form which looks like this:
<form name="myForm" method="post">
<button type="submit" onclick="submitForm(); return false">POST_to_weather</button>
var form = document.forms['myForm'];
form.action = 'https://mydomain.com';
var el = document.createElement("input");
el.type = "hidden";
el.name = myparam;
el.value = jQuery('#sk').val();
That appears to be a completely separate html page - as you don't load jQuery in it I doubt that anything will work.
I think that all you need is a script snippet that is run when the from page has loaded to read the data value and send it.
I was making this way too complicated. I solved the problem with a simple hidden html form which posts the data from a Custom Code action.
Many thanks and sorry to have troubled you with something that was in fact quite trivial.
2CheckOut.com Inc. (Ohio, USA) is an authorized retailer for goods and services provided by ChronoEngine.com