Forums

No check box info sent with form data

revive 01 Oct, 2008
Hello,
I just installed v.3.0 stable in Joomla 1.5.7 and love the ease of use.. I have searched through the forums and must say, these are some of the most helpful developers I have seen in a long time! Props to a great extension and great support.

On to the 'Pilot Error' I'm experiencing,.. like some of your users I'm not adept at forms.. So, I'll drop all the code I have on here and see where we can make it work.
The 'problem'.. I get the email fine, but the check box data does not come through. Specifically, I have 3 check boxes, one is required and only one.. to be checked.. I need that data in the email as well..
Here is the form code:
<div  class="form_item">
<div class="form_element cf_textbox">
<label class="cf_label">Name</label>
<input class="cf_inputbox required" maxlength="150" size="30" id="text_9" name="text_9" type="text">
<a onclick="return false;" class="tooltiplink">
<img  src="components/com_chronocontact/css/images/tooltip.png" class="tooltipimg" border="0" height="16" width="16"></a>
<div  class="tooltipdiv">Name :: Please enter your name here</div></div>
<div class="clear"> </div></div>
<div  class="form_item">
<div class="form_element cf_textbox">
<label class="cf_label">Email</label><input class="cf_inputbox required validate-email" maxlength="150" size="30" id="text_8" name="text_8" type="text"><a onclick="return false;" class="tooltiplink"><img  src="components/com_chronocontact/css/images/tooltip.png" class="tooltipimg" border="0" height="16" width="16"></a><div  class="tooltipdiv">Email :: Please enter your email address here</div></div><div class="clear"> </div></div><div  class="form_item"><div class="form_element cf_checkbox"><label class="cf_label">Pizza Selection</label>
<div class="float_left">
<input value="check" class="radio validate-one-required" id="Meat" name="check[]" type="checkbox">
<label for="Meat" class="check_label">Meat</label>
<br>
<input value="check" class="radio" id="Veggie" name="Veggie" type="checkbox"><label for="Veggie" class="check_label">Veggie</label>
<br>
<input value="check" class="radio" id="None_for me" name="check[]" type="checkbox">
<label for="None_for
_me" class="check_label">None For Me</label>
<br>
</div>
<a onclick="return false;" class="tooltiplink"><img  src="components/com_chronocontact/css/images/tooltip.png" class="tooltipimg" border="0" height="16" width="16"></a><div  class="tooltipdiv">Pizza Selection :: Please choose one</div></div><div class="clear"> </div></div><div  class="form_item"><div class="form_element cf_captcha"><label class="cf_label">Verification</label><span>{imageverification}</span><a onclick="return false;" class="tooltiplink"><img  src="components/com_chronocontact/css/images/tooltip.png" class="tooltipimg" border="0" height="16" width="16"></a><div  class="tooltipdiv">Verification :: Please enter the code as seen on your screen</div></div><div class="clear"> </div></div><div  class="form_item"><div class="form_element cf_button"><input value="Submit" name="undefined" type="submit"></div><div class="clear"> </div></div>


Here is my Email Template code:
HTML
<div class="form_item">
<div class="form_element cf_textbox"><label class="cf_label">Name</label><span>:  {text_9}</span>
<div class="tooltipdiv"><br /></div>
</div>
</div>
<div class="form_item">
<div class="form_element cf_textbox"><label class="cf_label">Email</label><span>:  {text_8}</span>
<div class="tooltipdiv"><br /></div>
</div>
</div>
<div class="form_item">
<div class="form_element cf_checkbox"><label class="cf_label">Pizza Selection</label>
<div class="float_left"><br />{check[]}<br /></div>
</div>
</div>


and viewable template:
Name:  {text_9}

Email:  {text_8}

Pizza Selection

{check[]}





Here is what comes through in the email:
Name:  Abc Def

Email:  abc_def@hotmail.com

Pizza Selection

check


Any help is greatly appreciated!

Thanks again,
Jesse
Max_admin 01 Oct, 2008
Hi Jesse, at the email template remove the [], this fixes it ?
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
revive 01 Oct, 2008
Hi Admin,

No, this didn't fix it.. here is the updated email template code:
<div class="form_item">
<div class="form_element cf_textbox"><label class="cf_label">Name</label><span>:  {text_9}</span>
<div class="tooltipdiv"><br /></div>
</div>
</div>
<div class="form_item">
<div class="form_element cf_textbox"><label class="cf_label">Email</label><span>:  {text_8}</span>
<div class="tooltipdiv"><br /></div>
</div>
</div>
<div class="form_item">
<div class="form_element cf_checkbox"><label class="cf_label">Pizza Selection</label>
<div class="float_left"><br />{check}<br /></div>
</div>
</div>



Also, here is the updated form code:
<div  class="form_item">
<div class="form_element cf_textbox">
<label class="cf_label">Name</label>
<input class="cf_inputbox required" maxlength="150" size="30" id="text_9" name="text_9" type="text">
<a onclick="return false;" class="tooltiplink">
<img  src="components/com_chronocontact/css/images/tooltip.png" class="tooltipimg" border="0" height="16" width="16"></a>
<div  class="tooltipdiv">Name :: Please enter your name here</div></div>
<div class="clear"> </div></div>
<div  class="form_item">
<div class="form_element cf_textbox">
<label class="cf_label">Email</label><input class="cf_inputbox required validate-email" maxlength="150" size="30" id="text_8" name="text_8" type="text"><a onclick="return false;" class="tooltiplink"><img  src="components/com_chronocontact/css/images/tooltip.png" class="tooltipimg" border="0" height="16" width="16"></a><div  class="tooltipdiv">Email :: Please enter your email address here</div></div><div class="clear"> </div></div><div  class="form_item"><div class="form_element cf_checkbox"><label class="cf_label">Pizza Selection</label>
<div class="float_left">
<input value="check" class="radio validate-one-required" id="Meat" name="Meat" type="checkbox">
<label for="Meat" class="check_label">Meat</label>
<br>
<input value="check" class="radio" id="Veggie" name="Veggie" type="checkbox">
<label for="Veggie" class="check_label">Veggie</label>
<br>
<input value="check" class="radio" id="None_for me" name="No Pizza" type="checkbox">
<label for="None_for_me" class="check_label">None For Me</label>
<br>
</div>
<a onclick="return false;" class="tooltiplink">
<img  src="components/com_chronocontact/css/images/tooltip.png" class="tooltipimg" border="0" height="16" width="16"></a>
<div  class="tooltipdiv">Pizza Selection :: Please choose one</div>
</div>
<div class="clear"> </div>
</div>
<div  class="form_item">
<div class="form_element cf_captcha">
<label class="cf_label">Verification</label>
<span>{imageverification}</span>
<a onclick="return false;" class="tooltiplink">
<img  src="components/com_chronocontact/css/images/tooltip.png" class="tooltipimg" border="0" height="16" width="16"></a>
<div  class="tooltipdiv">Verification :: Please enter the code as seen on your screen</div>
</div>
<div class="clear"> </div>
</div>
<div  class="form_item">
<div class="form_element cf_button">
<input value="Submit" name="undefined" type="submit">
</div>
<div class="clear"> </div>
</div>



How to I name the check boxes and then have that name show in the email?? Also, what should the 'name', 'id' and 'class' be? oops... these are radio buttons too, does that make a difference since I only need one item selected??

Thanks again
Jesse
revive 01 Oct, 2008
Sweet... just figured the problem out!!!

The 'value' needed to be the name in which i wanted to show in the email.. and the 'name' needed to be check[]😀

All works well !

Thank you!
GreyHead 01 Oct, 2008
Hi revive,

But you didn't just change the email template - you changed the names in the form html too . . . no surprise it doesn't work. (Later: I see you spotted that and posted whilst I was typing)

If you want 'one and only one' then you are best to use radio buttons. Here's how that code should look (less all the surrounding cruft):
<div>
<input type="radio" name="check[]" value="meat" id="meat" class="radio"  /> Meat<br />
<input type="radio" name="check[]" value="veggie" id="veggie" class="radio"  /> Veggie<br />
<input type="radio" name="check[]" value="none" id="none" class="radio validate-one-required"   /> None for me
</div>

Note that the class 'validate-one-required' should be in the last input and the three sould be wrapped in a <div> or a table cell so that the validation can tell what the group is.

Bob
revive 01 Oct, 2008
*****************
EDIT: Odd,.. I had tried to clear my cache several times previously... now, this time.. it magically worked.. all is good in the land of ChronoForms😀
*****************


Excellent,.. its working now. but now the Captcha says that its wrong... when the page loads??? !!!!!


Here's my updated form code:
<div  class="form_item">
<div class="form_element cf_textbox">
<a onclick="return false;" class="tooltiplink">
<img style="float:right;" src="components/com_chronocontact/css/images/tooltip.png" class="tooltipimg" border="0" height="16" width="16"></a>
<input name="text_9" type="text" class="cf_inputbox required" id="text_9" value="Name" size="30" maxlength="150">
<div  class="tooltipdiv">Name :: Please enter your name here</div></div>
<div class="clear"> </div></div>
<div  class="form_item">
<div class="form_element cf_textbox">
<a onclick="return false;" class="tooltiplink"><img style="float:right;" src="components/com_chronocontact/css/images/tooltip.png" class="tooltipimg" border="0" height="16" width="16"></a><input name="text_8" type="text" class="cf_inputbox required validate-email" id="text_8" value="Email" size="30" maxlength="150">
<div  class="tooltipdiv">Email :: Please enter your email address here</div></div><div class="clear"> </div></div><div  class="form_item"><div class="form_element cf_checkbox"><label class="cf_label">Pizza Selection</label><a onclick="return false;" class="tooltiplink"><img style="float:right;" src="components/com_chronocontact/css/images/tooltip.png" class="tooltipimg" border="0" height="16" width="16"></a><div  class="tooltipdiv">Pizza Selection :: Please choose one</div>
<div class="float_left">
<div>
<input type="radio" name="check[]" value="meat" id="meat" class="radio"  /> Meat<br />
<input type="radio" name="check[]" value="veggie" id="veggie" class="radio"  /> Veggie<br />
<input type="radio" name="check[]" value="none" id="none" class="radio validate-one-required"   /> None for me
</div>
<br>
</div>
</div><div class="clear"> </div></div><div  class="form_item">
<div class="form_element cf_captcha">
<label class="cf_label">Verification</label>
<span>{imageverification}</span>
<a onclick="return false;" class="tooltiplink">
<img  src="components/com_chronocontact/css/images/tooltip.png" class="tooltipimg" border="0" height="16" width="16"></a>
<div  class="tooltipdiv">Verification :: Please enter the code as seen on your screen</div>
</div>
<div class="clear"> </div>
</div>
<div  class="form_item">
<div class="form_element cf_button">
<input value="Submit" name="undefined" type="submit">
</div>
<div class="clear"> </div>
</div>

Any ideas?
Max_admin 01 Oct, 2008
"When the page loads" ? you mean when you open the page or when you submit it ?
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
revive 02 Oct, 2008
ODD !! Problem just stopped.. without changing anything.

To explain what was happening,. when I loaded the page (first load, not clicking the submit button).. after the page finished loading the form said that the CAPTCHA was wrong,.. but no one had entered anything... at all !😀

Glad it's resolved..
Max_admin 02 Oct, 2008
maybe you was loading the wrong URL, that's all!

Cheers

Max
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
This topic is locked and no more replies can be posted.

VPS & Email Hosting 20% discount

{item:title} {images:#}