Takis
Posts: 0
Joined: Wed Oct 22, 2014 5:10 pm

Get text from dynamically created checkboxes (text is populated from database)

Hi Evgene (=Ευγένιε means polite person)

Sorry my wrong, you are right !
Also your code works

----------------------------------

var checked = Appery('chkBox_Interests')
.find(':checked')
.map(function() {
return this.value;
}).get();
localStorage.setItem("lclStg_par1", checked);

----------------------------------

Thanks a lot for your answers!

Takis
Posts: 0
Joined: Wed Oct 22, 2014 5:10 pm

Get text from dynamically created checkboxes (text is populated from database)

Another question if I may.

How can I store these selections as the user settings/preferences ?
So the next time he opens the application the last selections are still there?

Thanks.

Evgene Karachevtsev
Posts: 12
Joined: Mon Apr 28, 2014 1:12 pm

Get text from dynamically created checkboxes (text is populated from database)

Hello Panagiotis,

Thank you)
After mapping you may run the following JS:
prevar savedValuesLS = localStorage.getItem("lclStg_par1"),
savedValuesArr = savedValuesLS.split(','),
val;

$('[name="mobilecheckboxgroup_16"]').each(function(){
val = this.value;
if ( savedValuesArr.indexOf( val ) -1 ) {
this.checked = 'checked';
}
}).checkboxradio('refresh'); /pre

Takis
Posts: 0
Joined: Wed Oct 22, 2014 5:10 pm

Get text from dynamically created checkboxes (text is populated from database)

Where/when this code should be executed? on exit?

Maryna Brodina
Posts: 0
Joined: Thu Apr 05, 2012 7:27 am

Get text from dynamically created checkboxes (text is populated from database)

Hello!

Please use this code on page Show event.

Return to “Issues”