Topic RSS
5:58 pm
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
[Image Can Not Be Found]
but I want them to be horizontal just like the following pic
[Image Can Not Be Found]
Thanks in Advance
6:57 pm
March 6, 2005
OfflineCurrently, 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.
4:43 am
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 ??
7:59 am
March 6, 2005
OfflineWith 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 '/'
6:40 pm
March 6, 2005
OfflineI'm quite positive that the above works, I've tried it.
What was the URL again?
5:39 pm
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
7:54 pm
March 6, 2005
Offline9:20 pm
March 6, 2005
Offlineok, 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]) );
Most Users Ever Online: 959
Currently Online:
110 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: 3548
Members: 1464
Moderators: 3
Admins: 1
Forum Stats:
Groups: 1
Forums: 4
Topics: 5157
Posts: 18386
Newest Members: juredujmovic, dreamkeeper, rajattyagi, wrokaa, lukass
Moderators: Paul (421), cnymike (8), sonika (95)
Administrators: Oliver (6398)
FAQs
Home
Add Reply
Add Topic
Quote












