Nathanael
Posts: 0
Joined: Tue Dec 11, 2012 11:25 pm

Submitting a form with changing elements?

I am populating a quiz with questions and options using a service (JSON) request. It works like a charm. However, I am confused about how to go about actually answering the quiz.

With PHP, I can submit a form, and all of the POST values are stored in an array that I can then manipulate. How can I "submit a form" using Appery.io? In the past, I've simply mapped field values to local storage variables, which I would then remap to a service request. This works fine when I have a static number of form elements. However, in the case of this quiz, there can be any number of questions and options.

How can I work this out?

maxkatz
Posts: 0
Joined: Fri Aug 13, 2010 3:24 pm

Submitting a form with changing elements?

You would do a REST service POST to your service (there are not forms).

Nathanael
Posts: 0
Joined: Tue Dec 11, 2012 11:25 pm

Submitting a form with changing elements?

Alright, gotcha.

I'm still a tad confused about how I'd actually implement this, though. Ideally, I'd like to be able to send that data to the next page before invoking the service, so that the service response can include a quiz results screen. Is that possible?

I suppose it could also be achieved in reverse, if there's a way to store a service response somehow.

maxkatz
Posts: 0
Joined: Fri Aug 13, 2010 3:24 pm

Submitting a form with changing elements?

Sure, you can do that via local storage (check our docs on how to do that).

Return to “Issues”