Buy Now
Sign in

How do I reload a form on selecting a different radio button please?

indieben , November 07 2018
I
indieben 83
November 07 2018 #381354
I have a form, for businesses and for individuals.
I don't want to present individuals with a cumbersome form if they select the wrong option. I have most fields set to hide and disable. If a user clicks the wrong option (and then selects the other option), I need the form to simply start from scratch and forget what was inputted before so it starts the whole cycle again.
The option is:
Are you a business or an individual?
Option 1: Business
Option 2: Individual.
Depending on which option is selected, different boxes present themselves.
I think a separate "reset form" button is a bit clunky.
Any suggestions please?
Many thanks.
healyhatman 4.4
November 07 2018 #381361
Just hide and disable the elements again.
Web developer at SkySpider.com.au
I don't work for ChronoEngine but I do accept donations paypal.me/healyhatman

You can now copy+paste code from forums
I
indieben 83
November 07 2018 #381366
That won't work because there are so many different combinations given that there is quite a lot of other logic. Any other ideas please, more along the above lines?
Thanks.
healyhatman 4.4
November 07 2018 #381369
make a custom html with a div with the id "choice_wrapper" and an attribute data-reloadurl="{event:choice_reload}"
In the events tab of your radio use #choice_wrapper as the identifier.
In the newly created choice_reload event use an event switcher, data source {data:your radio field}
In each option, use a custom code block with
<div id='choice_wrapper' data-reloadurl='{event:choice_reload}>
{chronoform:form you want}
</div>
Web developer at SkySpider.com.au
I don't work for ChronoEngine but I do accept donations paypal.me/healyhatman

You can now copy+paste code from forums
I
indieben 83
November 07 2018 #381374
Thanks for this, I hope that this Chronoforms bug gets sorted out as it's totally unusable for my needs at the moment. With a bit of luck I will get to put your kind word to good use.
Thanks again.
healyhatman 4.4
November 07 2018 #381375
No one else has reported that problem so it's a bit hard to know what could be causing it. Does it save and then when you reload they're all gone? On your bug post if you could describe exactly what happens and the steps you take that get you there. Maybe even post a before and after form backup.
Web developer at SkySpider.com.au
I don't work for ChronoEngine but I do accept donations paypal.me/healyhatman

You can now copy+paste code from forums
I
indieben 83
November 08 2018 #381376
Sure, Well the best I can do is narrow it down to the use of Partitions (and updating the names of each partition). Without any decent debug provided by Chronoforms, it's like stabbing around in the dark...
Yes, it does save and then they are gone when I reload. I've been as specific as I can in the debug post, the issue is, I don't know what is causing it.
Cheers,
healyhatman 4.4
November 08 2018 #381377
Well when you update the name it will delete everything in the old partition is that what's happening?
Web developer at SkySpider.com.au
I don't work for ChronoEngine but I do accept donations paypal.me/healyhatman

You can now copy+paste code from forums
I
indieben 83
November 08 2018 #381378
Well for example,
If I have
partition 1=#partition 1
partition 2=#partition 2 (or whatever)
I obviously would want to change partition 1 to:
partition 1=whateveriwant1 and I would want to change
partition 2= #whateveriwant2
Are you saying that changing these names (indeed the names that appear in the tabs) will always lead to the curtailing of fields?
Also, there are two partition update buttons...when should these be used and what is the difference please?
Thanks.
healyhatman 4.4
November 08 2018 #381379
Yes. If you change the partitions it has no way of knowing you're just *changing* it, it rebuilds it. You should be able to change the TITLE of the partition without losing everything though.
But just to check - have you really put in "partition1=#partition 1" ? Or is it "partition1:#partition 1"
And you use the button on the right, the left button is non-functioning. Probably accidentally left in there while the dev is working on something.
Web developer at SkySpider.com.au
I don't work for ChronoEngine but I do accept donations paypal.me/healyhatman

You can now copy+paste code from forums
I
indieben 83
November 08 2018 #381399
Hi Healyhatman,
Yes, it is put in as it should be, I've been typing without being able to see the GUI!
Interesting thing is, when the update partitions button is pressed, it is not deleting all of the data though. Some form fields still remain AND all of the records end up remaining in the database causing a serious issue where every block saved suddenly has the same reference (please see bug report). So the sum total is a reinstall when this issue happens.
I really don't understand why when the partition is updated why it should delete the contents -> there is no benefit to this happening. If one is updating the form then they clearly will not want to lose the contents. Are you also saying that, when updating the partition section name, the update partition button should NOT be clicked? Would this also be the same in the case of adding a third section in the partitions?
Any suggestions for fixing the database please? And then I suspect, armed with this new information from you, a new bug report is in order.
Thanks.
I
indieben 83
November 08 2018 #381400
For Everyone else, re the bug itself, it is currently logged here https://www.chronoengine.com/forums/posts/t106323/deleting-header-within-partition-deleted-shed-loads-of-fields - please see the distinct lack of any Developer response.
healyhatman 4.4
November 08 2018 #381404
Developer is unavailable as had already been explained.
And YOU know you're updating the id of the partition, but again there's no way for the system to know. For all it knows you've deleted the list of what you want and put entirely different things in, asking for whole new partitions and dispensing with the old ones.
Adding a new partition should not delete anything.
What do you mean by"fix the database"? Can you post on the bug post a form backup?
Web developer at SkySpider.com.au
I don't work for ChronoEngine but I do accept donations paypal.me/healyhatman

You can now copy+paste code from forums
I
indieben 83
November 08 2018 #381405
No it hasn't been explained, where are the Developers? There should be support available, where people are paying for a service, every day. If someone buggers off, someone else should be available.
Whilst I appreciate everything you are saying about the system not having the ability to actually remember what elements are stored at the time that the partition is updated, that is, in itself, a bug.
It's not to be expected that updating partitions = deleting elements = screwing up the database and it certainly doesn't say that in the documents.
The database cockup that was there before when this happened doesn't seem to have happened so far this time around.
Chronoforms is either seriously untidy when it comes to the database or it was never intended to delete fields when partitions are updated. For example, despite my two password fields having disappeared from my form designer view https://snag.gy/Ib2zir.jpg they are still in the database https://snag.gy/DNaLY2.jpg - what this says to me is that there was never any intention for the fields to drop at all....
Also what is the point of the "update partitions" button at all if all as it actually does is quick-delete contents?
Essentially, how do I get this stuff back into the database designer to fix it please?
I
indieben 83
November 11 2018 #381436
Healyhatman,
Your solution above would not work if there are events defined to display form fields upon selecting the "individual" radio button. I don't understand the other solution in relation to displaying other chronoforms either and I have replied in the respective question.
Thanks.
I
indieben 83
November 11 2018 #381437
Healyhatman,
Your solution above would not work if there are events defined to display form fields upon selecting the "individual" radio button. I don't understand the other solution in relation to displaying other chronoforms either and I have replied in the respective question.
Thanks.
healyhatman 4.4
November 11 2018 #381441
yes it will
Web developer at SkySpider.com.au
I don't work for ChronoEngine but I do accept donations paypal.me/healyhatman

You can now copy+paste code from forums
I
indieben 83
November 11 2018 #381458
Just had another crack at this. It still doesn't work.
Here's what I have done:
1) Created a HTML element as the first item on the form with the following contents:
<div id="RoleChangeEvent_Wrapper" data-reloadurl="{event:RoleChangeEvent}">
2) Created an Event within businesscheck (radio button):
OnChange, Action Function, Individual, Elements Identifier: #RoleChangeEvent
OnChange, Action Function, Business, Elements Identifier: #RoleChangeEvent
3) In the Load Section, underneath Display Section (already there by default) created a "SwitchEvents" with a name of "RoleSwitch" with Data Provider set to {data:businesscheck} Events: Business,Individual
4) In the "Business Event: I have placed custom code - Name: BusinessChangeEvent with contents:
<div id='RoleChangeEvent_Wrapper' data-reloadurl='{event:RoleChangeEvent}>
{chronoforms:wdd-quotation-form}
</div>
5) In the "Business Event: I have placed custom code - Name: IndividualChangeEvent with contents:
<div id='RoleChangeEvent_Wrapper' data-reloadurl='{event:RoleChangeEvent}>
{chronoforms:wdd-quotation-form}
</div>
Thanks.
healyhatman 4.4
November 11 2018 #381460
No you need to create another event, called RoleChangeEvent
Web developer at SkySpider.com.au
I don't work for ChronoEngine but I do accept donations paypal.me/healyhatman

You can now copy+paste code from forums
I
indieben 83
November 12 2018 #381464
Thanks for this, how does this fit in with my steps above please and how would the extra event "RoleChangeEvent" fit together with everything else please?
Thanks.