TOPIC:

Write textstring to hidden Textfield, based on selection of a radio group 3 weeks 4 days ago #253662

  • Topic Author
  • desoxire
  • Offline
  • Fresh Breezer
  • Fresh Breezer
  • Posts: 4
  • Thanks: 0
Hello!

I read lots of threats of this forum but I did not manage to get a solution for my problem.
I hope someone can help me.

I have a radio group named "membership" in my form. The possible values are 0 or 1.
Below this radion group I have a hidden text field named "membershipmessage".

I want to write text into the field "membershipmessage", depending on the selected value in "membership".

E.g.
if(ff_getElementByName('membership').value = 0){ ff_getElementByName('membershipmessage').value = "textstring1" }
if(ff_getElementByName('membership').value = 1){ ff_getElementByName('membershipmessage').value = "textstring2" }


Can you give me a hint, how I may achieve this?

Thank you for your help!
Max

Please Log in or Create an account to join the conversation.

Write textstring to hidden Textfield, based on selection of a radio group 3 weeks 4 days ago #253672

  • tihana.krivic's Avatar
  • tihana.krivic
  • Offline
  • Moderator
  • Moderator
  • Posts: 3785
  • Karma: 3
  • Thanks: 303
Hi,

go to your radiogroup->Advanced->Actionscript->check Custom->check Change and put:
function ff_nameradiogroup_action(element, action) 
{
     switch (action)
     {
          case 'change':
          vals = '';
          opts = JQuery("[name=\"ff_nm_nameofradiogroup[]\"]");
          for (o = 0; o < opts.length; o++)
          if (opts[o].checked)
          {
               vals = opts[o].value;
          }
          if (vals=="0") 
          {
              return ff_getElementByName('nameoftextfield').value = 'textstring';
          }
          else if (vals=="1") 
          {
              return ff_getElementByName('nameoftexfield').value = 'textstring';
          }
          else
          {
               return ff_getElementByName('nameoftextfield').value = '';
          }
          break;
          default:;
     } // switch
} // ff_nameofradiogroup_action
Please replace:
nameofradiogroup with name for your radiogroup (not title)
nameoftextfield with name for your textfield (not title)

Let me know if you need more help

Regards,
Tihana
The following user(s) said Thank You: desoxire

Please Log in or Create an account to join the conversation.

Last edit: Post by tihana.krivic.

Write textstring to hidden Textfield, based on selection of a radio group 2 weeks 3 days ago #254009

  • Topic Author
  • desoxire
  • Offline
  • Fresh Breezer
  • Fresh Breezer
  • Posts: 4
  • Thanks: 0
Dear Tihana!

Thank you very much for your help. Your solution worked fine for me.

Best regards
Max

Please Log in or Create an account to join the conversation.

Write textstring to hidden Textfield, based on selection of a radio group 2 weeks 3 days ago #254010

  • tihana.krivic's Avatar
  • tihana.krivic
  • Offline
  • Moderator
  • Moderator
  • Posts: 3785
  • Karma: 3
  • Thanks: 303
Hi,

super! I am glad I have helped :)

Please keep us motivated by leaving a small review here:
extensions.joomla.org/extension/contacts...orms/breezing-forms/
(Please turn off your VPN and local Apache prior reviewing as your review might get blocked)

Much appreciated!

Thanks & regards,
Tihana

Please Log in or Create an account to join the conversation.

  • Page:
  • 1
Moderators: ForumSupport
Time to create page: 0.042 seconds

BreezingForms Pro 1.4.7 for WordPress Released!

Available in the membership section.

September Discount!

Massive discounts on all subscriptions!

Get Your Subscription Here

Quick Links

Downloads

BreezingForms

ContentBuilder

BreezingCommerce

Templates

Documentation

BreezingForms

ContentBuilder

BreezingCommerce

Apprendre BreezingForms (French Community)

Apprendre et maîtriser BreezingForms par des tutoriels et exemples, le tout en français

breezingforms.eddy-vh.com

Questions et réponses sur les forums de l'AFUJ

AFUJ

Special Offer

Summer Sale! All subscriptions at a special price!

Includes prio support, all of our current and future Joomla!® extensions and Joomla!® templates for the duration of your membership.

Get it from here

3rd Party Discount - 25% Off

We help you to keep your costs under control. If you are a new member and purchased a form building tool from a different form vendor, then you'll get a 25% discount on our subscription plans.

How to receive the discount:

Send us a quick email to sales@crosstec.org with a proof of purchase (for example a paypal receipt), await payment instructions and enjoy your membership!