Forums

Again, checkbox doesn't show

chrishuang 01 Apr, 2009
Hi all,

I am idiot of html and have spent hours working on making the checkbox show...but failed. I need your help. Here is the code in my form...

  </div>
  <div class="clear"> </div>
</div>

<div class="form_item">
  <div class="form_element cf_radiobutton">
    <label class="cf_label" style="width: 170px;">Form of address</label>
    <div class="float_left">
      <input value="Mr." class="radio radio validate-one-required" id="Mr." name="radio0" type="radio" />
      <label for="Mr." class="radio_label">Mr.</label>
      <br />
      
<input value="Ms." class="radio radio validate-one-required" id="Ms." name="radio0" type="radio" />
      <label for="Ms." class="radio_label">Ms.</label>
      <br />


And what should be accordingly in my email template???

Thanks for your help in advance!

Chris
Max_admin 01 Apr, 2009
Hi Chris,

the code above will show the checkboxes fine, whats the problem you have exactly ?

Cheers
Max
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
chrishuang 02 Apr, 2009
Hi Max,

I am very glad to have your reply and is very prompt indeed.

I am having problem of showing checkbox result in my email template, meaning I couldn't see the check result in my inbox when getting it.

So based on the above, what should be put in my email template?? I checked the FAQs and all other reply but still didn't get a solve...

For the code showd above, it should show "Mr" or "Ms" when people check. I put
{radio0}
in my email template but it didn't work...I don't quite get the msg in the FAQs as well...

Checkbox fields need to have return an array of results, to do this the field name must be of the form name='field_name[]' with the two square brackets at the end.

If you don't do this then only the last checkbox ticked will be returned.

You must use the same array name e.g. name="field_name[]" for every related checkbox.



Thanks a lot if you could supply me with sth tangible to be put in my email template...!!

Chris
GreyHead 02 Apr, 2009
Hi Chris,

You should have

Form of address {radio0}

in your email template to show this field value.

The FAQ you quote refers to checkboxes, not to radio button groups, as they only return one value.

Bob

PS You have '.' in your ids which are technically invalid - but I don't think they are causing your problem here.
chrishuang 02 Apr, 2009
Hi Bob,

Thanks for the prompt reply and your support is the best amongst many that I used! I have followed your advice and done with the radio button. But I still have two questions,

For the radio button, if in the template, I want to hide the original text. For this one, if I want to hide "form of address" in the returned email to my inbox, would it be possible? If not, it doesn't matter.

The 2nd question is regarding the checkbox which I believe I failed to get the gist of what you are trying to say in the FAQs. My code is:
<div class="form_item">
  <div class="form_element cf_checkbox">
    <label class="cf_label" style="width: 170px;">Has you ever engaged consultant?</label>
    <div class="float_left">
      <input value="Yes" class="radio radio radio radio radio" id="Yes" name="check5[]" type="checkbox" />
      <label for="Yes" class="check_label">Yes</label>
      <br />
      
<input value="No" class="radio radio radio radio radio" id="No" name="check5[]" type="checkbox" />
      <label for="No" class="check_label">No</label>
      <br />
      
<input value="Planning" class="radio radio radio radio radio" id="Planning" name="check5[]" type="checkbox" />
      <label for="Planning" class="check_label">Planning</label>
      <br />
      

    </div>
    
  </div>
  <div class="clear"> </div>
</div>


So in my email template part, what information to put? I try "check5[]" and multiple similar entries with or without the question “Has you ever engaged consultant?”. They didn't work. What's correct to put in the email template? Like question one, is there any way that I could replace the "Has you ever engaged consultant?" as other text as in the template it is not necessary to let it appear in full or so..

Thanks again for your continous support!!

Chris
GreyHead 02 Apr, 2009
Hi Chris,

For the checkbox group you need

Have you ever engaged a consultant? {check5}

Notice no [] here (they are used to tell the browser to return an array of results).

"Have you ever engaged a consultant?" is just a text string - you can replace it with anything - or nothing.

Bob
chrishuang 02 Apr, 2009
Hi Bob,

That works spetacular! Your development of this rocks and I would certainly spread the words to all my friends!!! Thanks again for the help!

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