Dec 04, 2008, 12:55 AM *
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
Search via SMF or Google: modx forums all of modxcms.com web
  MODxCMS.com   Forums   Help Login Register  
News:Read what MODx Developers say: MODx Dev. Blogs
Pages: [1]   Go Down
  Print  
Author Topic: Has anyone got eform validation to work with radio buttons  (Read 221 times)
0 Members and 1 Guest are viewing this topic.
danzzz
Jr. Member
*
Posts: 5


« on: Sep 01, 2008, 07:11 AM »

Hi,

If anyone has got eform to work with radio buttons please can the post an example.
Many  thanks,
Dan
Logged
glardon
Jr. Member
*
Posts: 18


« Reply #1 on: Sep 07, 2008, 01:37 PM »

Yes, i did.

The only thing that still doesn't work is setting a default value. 
One way or the other the checked="checked" attribute is cleared by eform.
Someone any idea?

Cheers
Gino Lardon

Snippet call
Code:
[!eForm? &formid=`ContactForm` &to=`####@####.##` &tpl=`ContactFormTpl` &report=`ContactEmailTpl` &gotoid=`55` &subject=`Vraag of opmerking` &language=`nederlands`!]

Form template
Code:
<div id="errormessage">[+validationmessage+]</div>

<form id="ContactForm" name="ContactForm" method="post" action="[~[*id*]~]">

<fieldset>
        <legend><span>Vraag betreft * </span></legend>   
            <div class="formRowRadio"><input type="radio" checked="checked" name="betreft" value="mezelf" id="mezelf" eform="Vraag betreft::1"  /><label for="mezelf">mezelf</label> </div>   
            <div class="formRowRadio"><input type="radio" name="betreft" value="mijn ouder(s)" id="ouders"><label for="ouders" />mijn ouder(s)</label> </div>
            <div class="formRowRadio"><input type="radio" name="betreft" value="een ander familielid" id="familie"><label for="familie" />een ander familielid</label> </div>   
            <div class="formRowRadio"><input type="radio" name="betreft" value="een kennis of buur" id="kennis"><label for="kennis" />een kennis of buur</label></div>
            <div class="formRowRadio"><input type="radio" name="betreft" value="mijn organisatie" id="organisatie"><label for="organisatie" />mijn organisatie</label></div>
            <div class="formRowRadio"><input type="radio" name="betreft" value="een andere reden" id="ander"><label for="ander" />een andere reden</label></div>
</fieldset>

</form>

E-mail template
Code:
<table>
<tr><td>Betreft</td><td>[+betreft+]</td></tr>
</table>
Logged
ZAP
Testers
*
Posts: 1,387



« Reply #2 on: Sep 07, 2008, 10:22 PM »

You could use an eForm event function to set the default value before showing the form if no other value has been submitted.
Logged

"Things are not what they appear to be; nor are they otherwise." - Buddha

"Well, gee, Buddha - that wasn't very helpful..." - ZAP

Useful MODx links: documentation | wiki  | forum guidelines  | bug reports  | info you should include with your post | commercial support options
Pages: [1]   Go Up
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP

Copyright © 2005-2008 MODxCMS, All rights reserved. Contact Us
Styles by ziworks.com

Powered by SMF 1.1.4 | SMF © 2005, Simple Machines LLC

Valid XHTML 1.0! Valid CSS!