In Form.io, I have the Data Component and this in the name of the input box write data[FirstName]. This is very hard to manage in a self programmed endpoint to save data on own server.
Is there is a way to get Data Component in JSON format for submit then in a ajax request?
Thanks in advance.
Related
I want to post to an API in javascript and after posting page should redirect to another page and get the data from another API, can anyone help with the code. I will be using an html form to post data into an api
The Submit button of the form should trigger a function that posts the data to an API. This is a clear video on how to work with data and APIs in javaScript: https://youtu.be/Kw5tC5nQMRY
This is how to call a function when the form is submitted: https://www.w3schools.com/jsref/event_onsubmit.asp
Then you would redirect the user to a new page, where you can have code that will get data from another API. https://www.w3schools.com/howto/howto_js_redirect_webpage.asp
Basically what i want to do is SUBMIT a form which contains input values for a ride request [creating a ride request] and immediately after clicking submit,i want the inputed data to display on the same page(using EJS preferably) with all i have inputed [i.e as an actual ride request].
Note, i want to do it in a real time front end--back end environment where as i hit submit,it gets saved to the mongodb atlas database and still do the [above explained].
please anything to help would be appreciated, i am building a carpooling app and i have been stucked for days.
First of all you need to set up a RESTful api on the back-end. Have you done this?
You then use the fetch api to display the data. If you provide the restful paths, I can help..
Is it possible to store an image and some column fields in mysql database using only AJAX without action attribute in form tag? I am using contentType as JSON in AJAX to pass my column fields.
Is there any solution to send the image in the JSON format. Kindly provide the solution.
I have an Express.js application and I would like to know how I can persist form data (text area) after a post request without using AJAX.
I hope I am not vague. Thanks in advance.
The default value of a textarea is the child text node inside it. Copy the data into there, and put it in the response you make to the submission request:
<textarea name="foo">HTML escaped copy of the previously submitted foo</textarea>
I try to send data from a HTML form to a REST API which is created with the Symfony 2 PHP framework. The form data is processed with javascript (AngularJS) and send as JSON string to the API. Sending the data as HTTP PUT request works well. The problem appears if I try to validate the data.
To validate the data I created a form class and use the form validation mechanism of symfony2. Here the problem appears. The validation mechanism does not recognize my date format ... I tried it with the following format :
{'year':'2014','month':'05','day':'15'}
and
2014-05-15
In both cases the validation throws the error "birthday:\n ERROR: This value is not valid.\n"
I would be very pleased if someone could give me a hint to solve this.
Thanks in advance