Forums

Radiobuttons / Dropdowns get reset after form reload. How can I avoid this?

zergi 24 Jun, 2014
Hello Chronoforms-Team,

I've set up a form using several input fields, text fields, datepicker, radio buttons and dropdowns as well as the Captca module.

Whenever the captcha code is entered incorrectly, the usual server message appears on top of my form and the form is reloaded. The information that was entered in the input fields and text fields is restored, but all radio buttons and dropdowns are set back to their standard setting. Is there any way I can prevent the radio button / dropdown information from getting lost on reload?

In the form's setup I use the usual "event loop" if the "check captcha" method fails. Inside this event loop I use a simple "load" event.

Regards,
Sebis
Max_admin 27 Jun, 2014
Hi Sebis,

They should work fine, what are the fields names ?

Regards,
Max
Max
ChronoForms developer...
Did you try ChronoMyAdmin for managing your Joomla database tables ?
zergi 27 Jun, 2014
Hi Max,

thanks for your reply! One of those fields would be the radio button field named "deutschkenntnisse" (knowledge of the german language), which contains two radio buttons "yes" and "no".

For displaying all the params I've set up for this radio button field in the wizard designer, I'll post the code generated for this field:

<div class="gcore-line-tr gcore-form-row" id="ftr-deutschkenntnisse">
  <div class="gcore-line-td" id="ftd-deutschkenntnisse">
    <label for="deutschkenntnisse" class="gcore-label-left">_DEUTSCHKENN-LABEL</label>
    <div class="gcore-display-table gcore-input" id="fin-deutschkenntnisse">
      <div class="gcore-single-column" id="fclmn29">
        <div class="gcore-radio-item" id="fitem26">
        <input name="deutschkenntnisse" id="deutschkenntnisse25" value="_NEIN-VALUE" class="" title="_DEUTSCHKENN-TITLE"
        style="" data-load-state="" data-tooltip="" type="radio" /> 
        <label class="gcore-label" for="deutschkenntnisse25">_NEIN-LABEL</label></div>
        <div class="gcore-radio-item" id="fitem28">
        <input name="deutschkenntnisse" id="deutschkenntnisse27" value="_JA-VALUE" class="" title="_DEUTSCHKENN-TITLE" style=""
        data-load-state="" data-tooltip="" type="radio" /> 
        <label class="gcore-label" for="deutschkenntnisse27">_JA-LABEL</label></div>
      </div>
    </div>
  </div>
</div>


It's a multilanguage form. No radio options are preselected when the form is loaded first, and then again all selections are gone on reload.

Other radio-button fields that won't reload are named "wo-deutsch-gelernt" and "anzahl-stunden", the dropdown which is always reset on its first option is named "anrede".

Greetings,
Sebis
Max_admin 30 Jun, 2014
1 Likes
Hi Sebis,

That's because you are translating the fields values, this should not be the case, the values should be the same in all cases.

>>
value="_NEIN-VALUE"


Regards,
Max
Max
ChronoForms developer...
Did you try ChronoMyAdmin for managing your Joomla database tables ?
zergi 02 Jul, 2014
Hello Max!

Thank you for your answer, assigning a fixed value to those dropdowns and radio buttons did indeed solve the refreshing problem!

..but now I have another question:
Based on this multilanguage form I've set up a multilanguage email reply, in which the form user is getting a lists of his form inputs. Their respective dropdown-choices (which are translated in the form) need to be listed in that email, too.
That's why those dropdown- and radio button-values were translated in the first place, because I needed them to be different in the email for each language. Now everyone is getting the same fixed value as an email answer, which of course doesn't fit for every language.

Is there any way I can incorporate multilanguage functionality with those emails? Maybe I just didn't understand how this is working right. Thanks for your help!

Greetings,
Sebis
GreyHead 03 Jul, 2014
1 Likes
Hi Sebis,

Please see this FAQ - you can adapt this to show different values depending on the current language.

Bob
zergi 03 Jul, 2014
Answer
That was indeed the last piece of the puzzle. Problem solved!

Thanks a lot Max and Bob!
This topic is locked and no more replies can be posted.