cforms II User Forum

Registration is currently disabled.
Guest

FAQs

Login form protected by Login LockDown.


Lost password?
Advanced Search

— Forum Scope —

  

— Match —

   

— Forum Options —

    

Wildcard usage:
*  matches any number of characters    %  matches exactly one character

Minimum search word length is 4 characters - maximum search word length is 84 characters

Topic RSS
Splitting up “multi select box” values in the subject line
August 15, 2007
9:59 pm
Ann
Guest

Dear Oliver, thank you for the effort you have put into this plugin as well as supporting us users.

Is it possible to have the “multiple select box”-values inserted into the subject line in a predetermined syntax?
Say for example that a multi select box is defined with the following values (following your help-guide) red, blue, green, yellow, orange.
If a user selects for example red and green I would like the email subject to become:
Subject: [red] [green]
Is it possible to get the values in bracket like this?

I tried to follow your help guide as well as the following thread:
http://www.deliciousdays.com/cforms-forum?forum=3&topic=146&page=1&search=1

Your help is much appreciated.

August 15, 2007
10:06 pm
Oliver
Munich, Germany
Admin
Forum Posts: 6400
Member Since:
March 6, 2005
Offline

A quick way – if you don't mind having the brackets also in the email body (and possibly in the cforms tracking tables) – would be to show

red, blue, green…

to the user, but defining the actual associated values with brackets:

[red], [blue], [green]…

Again, the only drawback would be that these are the values then that get transmitted and recorded.

E.g.

Your pick#red|[red]#blue|[blue]#green|[green]… 

 

August 15, 2007
10:24 pm
Ann
Guest

Thank you for the quick reply.

Will the values be seperated with only a "space"-character, using the suggested method?
Like this, Subject:[red] [green] 

August 16, 2007
7:44 am
Oliver
Munich, Germany
Admin
Forum Posts: 6400
Member Since:
March 6, 2005
Offline

I think there is a comma inbetween, to change that, you may have to modify some code in cforms.php (~1135) for the non ajax:

                $all_options = $_POST['cf'.$no.'_field_' . $i];
                 if ( count($all_options) > 0)
                    $value = implode(',', $all_options);

see the comma?

And for the ajax version in js/cforms.src.js (~489):

        for (z=0;z<objColl[i].length; z++) {
              if (objColl[i].childNodes[z].selected) {
                    all_child_obj = all_child_obj + objColl[i].childNodes[z].value.replace(regexp, '$') + ','
              }
        }

 same here, replace the comma with a space.

Further, this javascript file (cforms.src.js) you need to rename to cforms.js and thus replace the existing one with this new, updated one. 

August 20, 2007
4:25 pm
planner
Guest

From the example on multiple select boxes, I can't get mine to work. I'm using this syntax:

Subject#Feedback#Reviews#Advertiser

TIA 

August 20, 2007
6:05 pm
Oliver
Munich, Germany
Admin
Forum Posts: 6400
Member Since:
March 6, 2005
Offline

planner said:

From the example on multiple select boxes, I can't get mine to work. I'm using this syntax:

Subject#Feedback#Reviews#Advertiser

TIA 


I checked with the online HELP and yes your syntax is correct.

August 20, 2007
10:05 pm
Ann
Guest

Thanks so
much for your quick and competent reply. I am still trying to implement your suggested
solution.

The purpose
of this exercise is to get your excellent contact forms to work together with
the postie plugin to be able to blog via forms.

I will let
you know of the outcome if you are interested.

August 20, 2007
10:13 pm
Oliver
Munich, Germany
Admin
Forum Posts: 6400
Member Since:
March 6, 2005
Offline

Ann said:

 

Thanks so
much for your quick and competent reply. I am still trying to implement your suggested
solution.

The purpose
of this exercise is to get your excellent contact forms to work together with
the postie plugin to be able to blog via forms.

I will let
you know of the outcome if you are interested.



Sounds great Ann, good luck!

Forum Timezone: Europe/Berlin

Most Users Ever Online: 959

Currently Online:
22 Guest(s)

Currently Browsing this Page:
1 Guest(s)

Top Posters:

tracedef: 43

mores: 21

Gyrus: 20

frozenwaste: 18

asuffredini: 15

photoworks: 14

Member Stats:

Guest Posters: 3744

Members: 1463

Moderators: 3

Admins: 2

Forum Stats:

Groups: 1

Forums: 4

Topics: 5344

Posts: 18713

Newest Members: juredujmovic, dreamkeeper, rajattyagi, wrokaa, lukass

Moderators: Paul (421), cnymike (8), sonika (95)

Administrators: Oliver (6400), Nicky (3)