Hi all,
I have a radio button (name of radio button is "strata_community_or_torrens_title), this radio button has three answers:
902.38=Strata Corporation Title
861.60=Community Corporation Title
793.62=Torrens Title
Later in my form I then have a HTML field where I want to show the answer from the radio button mentioned above in the format:
"Cost for your Form 1 will be ${data:strata_community_or_torrens_title}"
However, this does not work and all I get is "Cost for your Form 1 will be $"
Can anyone give me some help?
Thanks
Brad
I have a radio button (name of radio button is "strata_community_or_torrens_title), this radio button has three answers:
902.38=Strata Corporation Title
861.60=Community Corporation Title
793.62=Torrens Title
Later in my form I then have a HTML field where I want to show the answer from the radio button mentioned above in the format:
"Cost for your Form 1 will be ${data:strata_community_or_torrens_title}"
However, this does not work and all I get is "Cost for your Form 1 will be $"
Can anyone give me some help?
Thanks
Brad
Hi Brad,
β
There are no values from form elements in {data} until the form is submitted. You can show this value using a line of JavaScript that is called when the a radio button is selected.
β
Bob
β
There are no values from form elements in {data} until the form is submitted. You can show this value using a line of JavaScript that is called when the a radio button is selected.
β
Bob
Hi Bob,
Thanks for your reply. That makes sense now that you point it out.
As I'm a total newbie with JavaScript, is there any way you could help me out with JS required? I'd be happy to 'buy you a coffee' for your help π
Many thanks
Brad
Thanks for your reply. That makes sense now that you point it out.
As I'm a total newbie with JavaScript, is there any way you could help me out with JS required? I'd be happy to 'buy you a coffee' for your help π
Many thanks
Brad
In a JavaScript action in the Load event you will need a code like this:
β
Best regards
$('[name="radio5"]').on("change", function(){The coed above will print the radio value inside a text field with id text1
$("#text1").val($('[name="radio5"]:checked').val());
});
β
Best regards
Hi Max,
β
Thanks for that.
β
I have a couple of questions so please excuse my ignorance.
For reference I'm using ChronoForms 6 and Joomla 3.9.8
β
I've got it working so that it shows the checked radio option in a text field, but what I really need is for it to show at the end of a sentence within a Custom HTML field.
β
ie. "Cost for your Form 1 will be $#text1"
β
Is there some way I can do this?
Many thanks
Brad
β
Thanks for that.
β
I have a couple of questions so please excuse my ignorance.
For reference I'm using ChronoForms 6 and Joomla 3.9.8
β
I've got it working so that it shows the checked radio option in a text field, but what I really need is for it to show at the end of a sentence within a Custom HTML field.
β
ie. "Cost for your Form 1 will be $#text1"
β
Is there some way I can do this?
Many thanks
Brad
$("#text1").val("Cost for your Form 1 will be $" + $('[name="radio5"]:checked').val());
Thanks for that healyhatman.
β
That will make it read how I need it, but it still means that the only way to show/display it is via a text field. The text field means the user can edit it, which is a bit clunky considering all I want to do is print the result in plain old HTML, something like this:
β
I appreciate your help though, thanks.
β
That will make it read how I need it, but it still means that the only way to show/display it is via a text field. The text field means the user can edit it, which is a bit clunky considering all I want to do is print the result in plain old HTML, something like this:
<h3>Cost for your Form 1 application will be $ #text1</h3>I think what I need is for the JavaScript to provide a "value" that I can then call again and insert later in my form, but not via text field.
β
I appreciate your help though, thanks.
well then instead of setting the val() of a text field set the html() of a <span>
Perfect, thanks healyhatman.
β
Just for the record, this is what I've used:
β
Thank you
β
Just for the record, this is what I've used:
$('[name="radio"]').on("change", function(){And then in my html:
$("#text1").html("Cost for your Form 1 application will be $" + $('[name="radio"]:checked').val());
});
<h3 id="text1">Cost for your Form 1 application will be $TBC</h3>Works perfectly.
β
Thank you
This topic is locked and no more replies can be posted.