Re: [Cppcms-users] Multi-step forms
Brought to you by:
artyom-beilis
From: Martin B. <mar...@gm...> - 2020-10-16 12:59:32
|
Hi Joel, while not having looked at the jquery stuff I have a suggestion. The `cppcms::widgets` classes create the structure of the form and can be used in two ways. 1. Generate HTML from the structure 2. Parse the POST data that would be generated by such a form being submitted. Now if you make the POST data of the jquery form follow the structure of your `cppcms::widgets` form, then you can simply parse the POST data with said form. The HTML generation is then simply skipped. This would be a 50% workaround. Still have the manual created jquery wizard but also have the automated cppcms parsing. Ok, now you got me invested :D I briefly skimmed the link you sent. So the other 50% would possible by using the `<% form input ... %>` tag[1]. You could make your form in HTML but every time you would use an `<input>` tag you just use `<% form input IDENTIFIER %>`. This will need to be formatted correctly with CSS or you use `<% form begin ID %>` and `<% form end ID %>` Sincerely, Martin [1]: http://cppcms.com/wikipp/en/page/cppcms_1x_templates_comm#Rendering.Forms Am Freitag, den 16.10.2020, 11:01 +0200 schrieb jo...@em...: > The forms example is very straight forward and easy to work with. > However, I have to implement a step-by-step wizard using jQuery- > SmartWizard[1]. > As far as I can tell I cannot use the `cppcms::widgets` to create the > form as I need some "custom" HTML as the form is split into multiple > sections etc. > At the end, there's some "Finish" button which triggers a Javascript > function which will post the content of the form. I would then > attempt to parse the POST request manually in the C++ code. > > Is this the recommended way of doing this? Or is there a way to > customize the HTML code generated by the form widgets so that it > structurally matches what I need for the smart wizard? > > > [1] http://techlaboratory.net/jquery-smartwizard > > Best regards, > ~ Joel > > > > _______________________________________________ > Cppcms-users mailing list > Cpp...@li... > https://lists.sourceforge.net/lists/listinfo/cppcms-users |