Page 2 of 2

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

Posted: Fri Oct 24, 2014 7:22 am
by Takis

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!


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

Posted: Fri Oct 24, 2014 7:24 am
by Takis

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.


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

Posted: Fri Oct 24, 2014 9:39 am
by Evgene Karachevtsev

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


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

Posted: Mon Oct 27, 2014 10:40 am
by Takis

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


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

Posted: Mon Oct 27, 2014 2:49 pm
by Maryna Brodina

Hello!

Please use this code on page Show event.