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
How to make horizontal fields?
June 1, 2007
5:58 pm
FahadOnline
Guest

Hi,

I've been testing cforms for few weeks and I'me unable to find something in the help page descriping how to make some fields horizontal ..

Let's assume we want the visitor to insert his birth day … I want to use a drop down lists (Day – Month – Year ) … and they will be shown virtically at the form page … see the pic

but I want them to be horizontal just like the following pic

 

Thanks in Advance 

June 1, 2007
6:57 pm
Oliver
Munich, Germany
Admin
Forum Posts: 6400
Member Since:
March 6, 2005
Offline

Currently, only label & input field pairs are supported, your example would require the plugin to associate multiple input fields with one label.

Why not use just one textfield to allow the user to enter his birthday, the field yould show the expected format dd/mm/yyyy (cleared on focus) and if needed run a regexp check to ensure proper entry.

June 7, 2007
4:43 am
FahadOnline
Guest

and that can be done using a text field with the following :

Date Of Birth|dd/mm/yyyy|(?<day>\\d{1,2})/(?<month>\\d{1,2})/(?<year>(?:\\d{4}|\\d{2})

 

Right ??Laughing

June 7, 2007
7:59 am
Oliver
Munich, Germany
Admin
Forum Posts: 6400
Member Since:
March 6, 2005
Offline

With regexps there are always more ways to accomplish the same thing. not sure what <day>  does however.

Here is a good regexp repository so users don't have to reinvent the wheel :) 

This is what they say: ^([0-9]{0,2})-([0-9]{0,2})-([0-9]{0,4})$

You may want to replace the '-'  with a '/'

June 10, 2007
5:47 pm
FahadOnline
Guest

Actually both of them didn't work ….Frown

June 10, 2007
6:40 pm
Oliver
Munich, Germany
Admin
Forum Posts: 6400
Member Since:
March 6, 2005
Offline

I'm quite positive that the above works, I've tried it.

What was the URL again? 

June 14, 2007
5:39 pm
FahadOnline
Guest

I'm using it like this

Date Of Birth|dd/mm/yyyy|^([0-9]{0,2})/([0-9]{0,2})/([0-9]{0,4})$

with single line text

but in the form it wont accept the date when submitting and mark it red 

June 14, 2007
7:54 pm
Oliver
Munich, Germany
Admin
Forum Posts: 6400
Member Since:
March 6, 2005
Offline

works for me, even your definition.

June 14, 2007
9:20 pm
Oliver
Munich, Germany
Admin
Forum Posts: 6400
Member Since:
March 6, 2005
Offline

ok, after more testing it seems that / cause the error only in non-ajax mode. so a little more detail on your configuration would have helped.

search for this line in cforms.php  (~675) :

$reg_exp = stripslashes($obj[2]);

and replace with:

$reg_exp = str_replace('/','\\/',stripslashes($obj[2]) );

Forum Timezone: Europe/Berlin

Most Users Ever Online: 959

Currently Online:
25 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: 3731

Members: 1463

Moderators: 3

Admins: 2

Forum Stats:

Groups: 1

Forums: 4

Topics: 5332

Posts: 18692

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

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

Administrators: Oliver (6400), Nicky (3)