Forums

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

indieben 07 Nov, 2018
1 Likes
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 07 Nov, 2018
Just hide and disable the elements again.
indieben 07 Nov, 2018
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 07 Nov, 2018
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>
indieben 07 Nov, 2018
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 07 Nov, 2018
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.
indieben 08 Nov, 2018
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 08 Nov, 2018
Well when you update the name it will delete everything in the old partition is that what's happening?
indieben 08 Nov, 2018
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 08 Nov, 2018
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.
indieben 08 Nov, 2018
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.
indieben 08 Nov, 2018
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 08 Nov, 2018
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?
indieben 08 Nov, 2018
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?
indieben 11 Nov, 2018
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.
indieben 11 Nov, 2018
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.
indieben 11 Nov, 2018
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 11 Nov, 2018
No you need to create another event, called RoleChangeEvent
indieben 12 Nov, 2018
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.
healyhatman 12 Nov, 2018
make a custom html with a div with the id "choice_wrapper" and an attribute data-reloadurl="{event:RoleChangeEvent}"

In the events tab of your radio use #choice_wrapper as the identifier.

Create an event called RoleChangeEvent, and in it use an event switcher, data source {data:your radio field}. Put the list of options in and hit update.

In each option block, use a custom code block with
<div id='choice_wrapper' data-reloadurl='{event:RoleChangeEvent}>
{chronoform:form you want}
</div>
indieben 12 Nov, 2018
Thanks,

Is this in addition to the above or replacing some of the above steps?

Thanks.
healyhatman 12 Nov, 2018
Replacing since you've named things differently
indieben 12 Nov, 2018
What exactly is supposed to be different other than the fact you want my website to use your names for no apparent reason? Are you saying that choice_wrapper is a reserved div within Chronoforms for a specific function?

<div id='choice_wrapper' data-reloadurl='{event:RoleChangeEvent}>
Is this not supposed to have a closing ' or " (Please see my next point)?

in any event, I thought it would use double quotes with HTML).

make a custom html with a div with the id "choice_wrapper" and an attribute data-reloadurl="{event:RoleChangeEvent}"



Should this not have a div closing tag?

Create an event called RoleChangeEvent, and in it use an event switcher, data source {data:your radio field}. Put the list of options in and hit update.


There isn't an "event" function within Chronoforms. Do you mean "Use an event switcher to create an event called RoleChangeEvent, data source...".

and i've done what you said, to the letter (two posts back, not including this one) just for kicks, and it doesn't work.
healyhatman 12 Nov, 2018
Createa new event in the setup tab. Down the bottom there's an input for you to enter the name of the event and a button.

Considering how much time I'm spending on you for free you could also try being less rude.
indieben 12 Nov, 2018
"Considering how much time I'm spending on you for free you could also try being less rude."

If you actually explained things properly in the first place, this would long since have been accomplished. If the Developer who is quick enough to take people's cash actually didn't go swanning off on his travels before first making sure that there was actually a proper Development team in place, if the manual actually made sense - it is diabolical and V6 was not rolled out until all of the bugs had been sorted out, none of this would be necessary.

Instead there's a product that is so entirely sh*t that, despite it being set up to avoid coding, the product actually needs code to be able to produce the functionality advertised. I'm starting to think it would be a million times easier to code the forms from scratch since code is required anyway.

You still haven't answered the questions above. Either that or, since you seem to be sitting in for the Developer (i'm sure that's not for free),please kindly refund me the license fee and i'll have a crack at creating my own forms or,alternatively use the much more sane Breezing Forms. Failing both, i'll raise a chargeback with my bank.
healyhatman 12 Nov, 2018
It doesn't need coding for the advertised functionality - what you're after is outside the standard functionality, so you need to code. Except that you don't need to code, because I handed you everything you need to do. I gave you step by step instructions, it really isn't my fault that you don't understand enough about CFv6 to be able to follow them.

For the questions you asked, yes of course you need closing tags and quotations. Come on.
indieben 12 Nov, 2018
"What you're after is outside the standard functionality, so you need to code..."

Chronoforms (From the website list of features).

1. "Build Forms Of Any Kind" -> Clearly not, see, there'd be no point in using Chronoforms if I was a coder as it would be less trouble to debug my own code so clearly this is implying that anything is intended to be within the functionality. Perhaps a little asterisk with "You still need to be a coder to achieve anything complicated". Although i'm not an advanced coder, I do know HTML. What I didn't know was whether the incorrect syntax that you used was intentional and necessary to get Chronoforms to work.

2. "Multipage forms - Extend Your Form over multiple pages or multiple tabs/steps for a better user experience" -> Until you press "update partitions" which doesn't actually seem to be there for any other reason than to break a form and stuff up the database. It doesn't even clear the partition - it makes so many elements disappear at the end of the form whilst leaving the records in the database.

3. "Database connection Read, Add, Update or Delete Data from one or more database tables , and connect to external database" -> Well Chronoforms, upon uninstalling, doesn't even delete it's tables out of the Joomla database and, when the "trusty" update partitions button is pressed, it leaves the database out of tandem with the design interface because, despite deleting elements from the designer, it doesn't delete them from the database. I wouldn't fancy my chances letting Chronoforms touch another database. It's bad enough that it shares Joomla's.

4. "Upload and attach files..." -> There is no security built in and the user is left to sort that out themselves. This "feature" in fact creates a major vulnerability.

5. "Google Address Map..." -> You're on your own unless you actually pay Google for this, effectively paying twice for the functionality and with no ability to use an alternative lookup without hard coding it.

and that's just what i've tried to use. I should highlight the lack of any mention, whatsoever, that many of the features need serious amounts of coding to actually work - for example, adding users to Joomla. I really hope people back up their databases first or God help them.

"it really isn't my fault that you don't understand enough about CFv6..." How do you expect me to understand Chronoforms V6 with such a diabolical manual and when the example form doesn't actually contain an example?

With respect to you personally, there is no Event element/function. Do you mean "switch event". What you haven't done, and it would really help, is if you would please kindly, actually, simply, highlight what i've done wrong in my steps above and highlight what you want me to instead. I'm none the wiser after your last post.

And, thanks.
healyhatman 12 Nov, 2018
So I made a mistake, my bad. Here are very detailed step by step instructions. Before I start though let me say (again) this is not the best way of doing this, it's the way you've requested. The better way would be to have different sections in the same form that get displayed depending on your choice.

And if you can't follow these instructions, send the developer an email and ask for a refund because I'm done helping. You don't need to name things what I name them, it's there for consistency and to better demonstrate what needs to go where. Replace the names with whatever you want just make sure you're consistent.

DO NOT COPY PASTE ANYTHING FROM HERE. The forums adds hidden formatting characters.

-----------------------------------
1. In your main form, under the "Design" tab, have a "radios group". Under name put "form_choice", for options put
1:First Form
2:Second Form
Under the "events" tab of the radio group, Set "On" to change, Under Actions put "reload", under "Element(s) identifer" put "#form_reload_wrapper"

2. In your main form, under the "Design" tab, have a "Custom HTML" element. Contents:
<div id="form_reload_wrapper" data-reloadurl="{url:reload_event}&tvout=view"></div>

3. Go to the "Setup" tab, it's next to the "Design" tab up the top.

4. Scroll down to the very bottom of the page. There is a text box there with the placeholder text "Event name...". Enter reload_event into this text box and click the Add Event button.

5. Into the new event that just got created, drag an "Event Switcher". Under data source enter {data:form_choice}.

6. In the "Events - comma separated" field enter 1,2 and click update events

7. In each block that has been created drag a "Custom Code" element. Contents
<div id="form_reload_wrapper" data-reloadurl="{url:reload_event}&tvout=view"> {chronoform:form_name} </div>
replace "form_name" with the alias of the form you want displayed when the user chooses that option.

8. Click SAVE.

--------------------------
As for your other complaints
1. You CAN build any form you want, but I honestly didn't think anyone other than you is surprised that complex actions require coding.
2. Known issue, looks like the dev is working on a better way of doing it.
3. I for one would not want the tables deleted automatically in case a stupid client uninstalls it accidentally and loses everything but maybe it should remove its core tables sure
4. What security are you after exactly
5. This complaint in particular is extremely petty and ignorant. There are heaps of alternatives to choose from and expecting the dev to cater to them all is expecting too much. NOTHING is stopping you using your own solution, but Google Maps code and whatever else you'd want to use ARE DIFFERENT you can't just change the name and expect it to work he would have to custom make an address widget for every single one and there's just no point. Like I said the solution you want to use gives you 1/10th the number of free lookups per day - Google Maps provides $200 free monthly credit which is good for 300 lookups per day compared to your 20. And being asked to supply your own API key is COMPLETELY AND UTTERLY STANDARD BEHAVIOUR. I haven't noticed you on the Joomla Facebook page complaining that Joomla requires you to get your own ReCaptcha API key.
indieben 13 Dec, 2018
Thanks, that has finally got it working so that it displays the first question and then a form loads below it. Is it possible to have the first form disappear altogether - I think that was effectively the other thread question...

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