Page 1 of 1

Submitting a form with changing elements?

Posted: Mon Jul 01, 2013 6:26 pm
by Nathanael

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?


Submitting a form with changing elements?

Posted: Mon Jul 01, 2013 6:28 pm
by maxkatz

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


Submitting a form with changing elements?

Posted: Mon Jul 01, 2013 6:41 pm
by Nathanael

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.


Submitting a form with changing elements?

Posted: Mon Jul 01, 2013 9:03 pm
by maxkatz

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