LevelTen Apps Support Forum Forum Index LevelTen Apps Support Forum

 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Processing multiple choice form

 
Post new topic   Reply to topic    LevelTen Apps Support Forum Forum Index -> Use & Operations (L10Fm)
Author Message
Ello



Joined: 27 May 2005
Posts: 2

PostPosted: Fri May 27, 2005 1:14 pm    Post subject: Processing multiple choice form Reply with quote

I created a multiple choice select list in my form that allows users to choose several options by holding down Control key. The problem is that L10FmX.php doesn't process the multiple choice. Does anyone know how to change the code in PHP file?
Back to top
ipaulo



Joined: 25 Jul 2005
Posts: 1

PostPosted: Mon Jul 25, 2005 6:53 pm    Post subject: re: Processing multiple choice form Reply with quote

I wanted to do the same thing. I'm not much of a programmer, so I'm sure this is going to be really ugly but it works. It also includes a line to skip blank fields. Look for this code:

Code:
foreach($_POST as $k => $v) {
        if($htmlFormat) {
                $v = str_replace("\n","<br>\n",$v);
        }
        if($i) {
                $msg .= "$bl0$k:$ld$v$el";
        } else {
                $msg .= "$bl1$k:$ld$v$el";
        }
        $i = !$i;
}


replace it with this:

Code:
foreach($_POST as $k => $v) {
        if ($v == '') continue; // skip empty fields

        if($htmlFormat) {
                $v = str_replace("\n","<br>\n",$v);
        }
        if (is_array($v)) {
                for ($z=0;$z<count($v);$z++) {
                        if($i) {
                                $msg .= "$bl0$k:$ld$v[$z]$el";
                        } else {
                                $msg .= "$bl1$k:$ld$v[$z]$el";
                        }
                        $i = !$i;
                }
        } else {
                if($i) {
                        $msg .= "$bl0$k:$ld$v$el";
                } else {
                        $msg .= "$bl1$k:$ld$v$el";
                }
                $i = !$i;
        }
}
Back to top
Display posts from previous:   
Post new topic   Reply to topic    LevelTen Apps Support Forum Forum Index -> Use & Operations (L10Fm) All times are GMT - 6 Hours
Page 1 of 1

 

LevelTen Dallas Web Design & Flash
Web Development | Web Hosting | e-Commerce | Search Engine Optimization
Local SEMS | Sites Directory


Powered by phpBB © 2001, 2005 phpBB Group