Branden
Posts: 0
Joined: Sun Nov 03, 2013 12:10 am

How to pass values of checked boxes to another page?

First off, I'm new to Appery. That being said...

I have a page that has a dynamically generated list of check boxes. Let's call this checkbox group "combat_char_list". Each individual checkbox is called "char_entry".

I'm trying to get the values of the checked boxes and carry them over to another page.

In trying to figure out a way to do this, I borrowed some JavaScript that I read in another post. I am able to get the app to acknowledge that, say, two check boxes were checked... but for the Label value, it's spitting out "Item 1" for each. "Item 1" is the default value PRIOR to my list query being executed. Yet the JavaScript is the last thing run.

I know jQuery Mobile has some funky stuff when is comes to page creation. I know when I wrote jQuery Mobile apps manually, I would have to run a .refresh() or something to get the new values to appear in the DOM. Do I need to do something similar here?

I'm not even sure if I'm going about all this correctly. Any help/suggestions is appreciated.

Note: so far, I'm rather impressed with Appery. So far, so good!

Igor
Posts: 0
Joined: Tue Apr 02, 2013 12:05 pm

How to pass values of checked boxes to another page?

Hello,

Could you clarify do you generate list of check boxes using REST service or using some JS code?
You can save check box values to the localStorage variable or to Database and get this values in new page.

Branden
Posts: 0
Joined: Sun Nov 03, 2013 12:10 am

How to pass values of checked boxes to another page?

Thank you for the reply.

I'm generating them using REST service.

The problem I'm having is that I can't seem to capture the correct values. It's collecting the "default" value of the checkbox. That is, it's capturing the value of the checkbox before the values are generated by the REST service.

Does that make sense?

Igor
Posts: 0
Joined: Tue Apr 02, 2013 12:05 pm

How to pass values of checked boxes to another page?

Do you want pass values of selected check boxes to another page or all check box values?

Branden
Posts: 0
Joined: Sun Nov 03, 2013 12:10 am

How to pass values of checked boxes to another page?

I want to pass values of selected check boxes to another page.

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

How to pass values of checked boxes to another page?

To pass any data to another page you can use local storage: http://docs.appery.io/documentation/u...

Can you show us how you read the values form the check boxes?

Branden
Posts: 0
Joined: Sun Nov 03, 2013 12:10 am

How to pass values of checked boxes to another page?

Hmm... the impression I'm getting from that post is that I have to get an array of values and iterate through them on the next page.

However, as I said in my question, I want to get the values of the generated check boxes. Not the default value that the Appery tool is providing to it. Instead of getting the values of the checkboxes, I'm getting "Item 1" over and over again... How do I work around that?

Branden
Posts: 0
Joined: Sun Nov 03, 2013 12:10 am

How to pass values of checked boxes to another page?

I just figured out part of my problem. I was getting "Item 1" because my List service was putting the value from the database into "Text" instead of "Value". So the default value of "Item 1" was never being changed. :-)

Igor
Posts: 0
Joined: Tue Apr 02, 2013 12:05 pm

How to pass values of checked boxes to another page?

What is the another part of your problem?

Return to “Issues”