Display data after submit

sortby 20 Jun, 2015
Hello,
first of all congratulation for Chronoforms 5 is MASSIVE!
I'm building a survey of 5 questions with checkbox_group for each question.
After SUBMIT button I would display "something" that show the result of each checkbox value possibly without change page.
Is that possible without DB saving?
I have seen the "handle arrays" but now sure if this fits my needs.

Thanks for the support!
Frank
GreyHead 21 Jun, 2015
1 Likes
Hi Frank,

First, if this is a questionnaire do you want to use Checkboxes - where more than one answer can be checked - or Radio Buttons - where only one answer is allowed?

You can use the Display Message action to show a message including the form input values - add {input_name} to show a value.

If you are using Checkboxes, then a Handle Arrays action will cover the results from an array to a string that will display.

Bob
sortby 21 Jun, 2015
Thanks Guys!
I have solved with your help!

Have a nice time!
sortby 21 Jun, 2015
Hi GreyHead,
thanks for your support.
My questionnaire use Checkboxes, I have solved using "on Submit" Handle Arrays + Custom code when I have displayed "name_goup_array" with html custom code.
The main html render is ajax based, so after submit button it display the custom code on the same page, the main problem I'm facing is that after reload of the page the page is displayed in the middle of the custom code.

Example after submit button and ajax load:
1 | - START html custom code- TITLE
2 | - empty space
3 | - code
4 | - code
5 | - code
6 | - END html code
The page is loaded at around point 3/4....my goal is to reload at point 1 of custom code.

How to achieve this....using html anchor or custom js code?

Many thanks!
Have a nice time
GreyHead 22 Jun, 2015
Hi Frank,

I'm not clear exactly what is happening here? What is the Custom Code that you are using?

Bob
sortby 22 Jun, 2015
Hi Rob,
is a custom code with basically:
On top - {name_group_array} display
On the rest - simply html tags with text and images.

All works like a charms...but when this custom code is loaded (after submit) the browser position the scroll near the middle of the page ( as I have tried to explain in previous post) and this hide "in some way" my array to be seen at first look.
So user has to scroll up to see the array...otherwise they loose the info...and this is a big mess!🙂

So... is there a way to reload the page (is a ajax html render after submit) positioning the scroll on the beginning of module or in a custom position? My ideas runs around html anchor or JS code but not sure how to implement.

Many thanks for your support!
GreyHead 22 Jun, 2015
Hi Frank,

Thank you that helps. The code in this post might help if you can run that after the Ajax reload?

Bob
sortby 22 Jun, 2015
Hello Bob,
thanks for the link...we are almost close to the solution🙂
I have tried to load after my code but dosen't work as expected.
I'm really JS illitterate but would love to solve with my hands🙂

If I'm not wrong we have two parts
A - class="myformanchor"
B - the js code (with #classname)

So some small questions to find a direction,
1 - I have to put the js code(B)...in the OnSubmit event just after my custom code right? [done]
2 - is not clear what is referring (in the example you linked me) the "class="myformanchor" (A) ( is a JS class, is a html div class tag, is a html anchor tag?) and where to put it in my case

Looking forward to hearing from you soon🙂
Thanks
p.s. in attach my form settings
sortby 24 Jun, 2015
Ok Rob,
I have solved with a little bit of luck.
I have loaded the js code simply in my custom code using old school <script> tag.
Don't know why with additional "load javascript" had trouble...by the way...end of story!

Thanks for your support!🙂
Frank
GreyHead 27 Jun, 2015
Hi Frank,

Looking at this late :-(

I think that the Load JavaScript action only works in combination with with an HTML (Render Form) action, that would explain this. Usind <script> in a Custom code action will work. Or you can use the Joomla! methods
<?php
$app = \JFactory::getApplication();
$script = "
// some script here
";
$app->addScriptDeclaration($script);
?>

Bob
This topic is locked and no more replies can be posted.