Re: [Cppcms-users] form.load(context()) doesnt work when...
Brought to you by:
artyom-beilis
From: Artyom B. <art...@ya...> - 2012-05-12 11:59:22
|
>a field such as select gets populated by AJAX. > >Ive got 2 selects. One gets populated the usual way via select.add(name, >value) and depending on what user chooses, the 2nd select gets populated >through AJAX. > >The problem is the only way to get the value is via request().post(name). > >In effect this bypasses form.validate() > See, if the 2nd select is populated by the ajax that means that you don't know what are the valid choices, that means that validate() can't actually validate the required form. In that case just use request().post(name) because in any case you need your own validation logic. Artyom |