Topic RSS
3:05 pm
Hi,
I was wondering if this plugin allows to auto fill certain data/fields for logged-in users like Name, Email etc. that already the user has filled while registering.
Or perhaps if you could suggest a way to put a php code in the fields in form settings page, just like you have variables {VariableName}
regards,
Manish
5:21 pm
March 6, 2005
Offlinecforsm fully supports "default values", see the Help! section. The format for the field names is name|default value|etc….
6:58 pm
Dear Oliver, I guess my query was not properly understood.
I need to auto fill certain data of the user in the contact form. Basically this data is what user had already provided during registration
like his Email, Name, City, Country, Phone etc. I dont want the registered and logged-in user to fill this data again.
How can this be done. Is there a way to add some PHP code to the form.
10:15 pm
March 6, 2005
OfflineSorry, I misread your question. The answer remains yes, though. However, to accomplish this, you'll have to use dynamic forms. There are examples (under Help!) of how to make use of this feature by using appropriate PHP code and function call to render the form(s) at runtime. This way you can determine individually what needs to go into the default values.
insert_custom_cform( $fields:array, $form-no:int );
7:40 am
Thanks Oliver. I will try to experiment with dynamic forms, but truely speaking, I am not very sure if I would be able to do it without your help. But I understand, you cannot provide customized solutions to everyone, still I would like to request you in case this problem/requirement has been dealt earlier, then kindly point me in that direction.
It surely is a very nice plugin. If you like, I can put a review of this plugin on http://www.ktpl.com
regards.
7:47 am
March 6, 2005
OfflineNo problem Manish, just use this thread for follow ups. I'll be traveling all this week, so I probably won't be able to respond before Friday.
9:14 am
1. I read the help section but cudnt understand where to insert cutom field/form ?
2. Is it possible to add php code, say to validate input of a particular field, if the form is generated using cforms control panel ?
10:42 am
March 6, 2005
Offlineto 1:
you need to add the respective PHP code for inserting the form to one of your PHP WP theme templates, e.g. page.php, single.php, search.php etc. (or create a new, specific one for a custom contact page), the Help! section shows the function call needed to insert the form.
to 2:
field validation is done via regular expressions, they can also be added during run-time (when the form is put together). so you can determine the regular expression for a given field before, but you can not programatically add custom PHP code to be executed AFTER form submission. hope that makes sense.
12:25 pm
Regarding validation of field : Ok I get the idea. But just in case if you can help me with some example, say I need to accept a number from a user between 1 and 3000, how can I do it with reg exp.
5:44 pm
March 6, 2005
OfflineHave you seen the regexp documentation (and link to a regex portal) on the Help page? Try the link, the portal has some thousands of pre-made regexps.
In this case, I'd try: ^([0-9]{1}|[0-9]{2}|[0-9]{3}|[0-2]?[0-9]{3}|3000)$
This should cover all one digit, two digit, …numbers up to 3000.
Most Users Ever Online: 959
Currently Online:
86 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











