Hi there,
I've the following problem. I use CForms as a 'front end formbuilder' to submit information in a webapplication of which i cannot change the formfield names.
One of the fields which needs to be populated is called (and has id) 'name'. When I apply a custom formfield name ([id:name]} cforms throws an error (Not Found Apologies, but the page you requested could not be found. Perhaps searching will help.) on submitting to the next form of a multipage form. If I change the field name to something else, there is no problem. The custom id 'name' seems to be responsible for he problem, maybe it is used as a part of the modules logic or something?
Since custom id name 'name' didn't work I thought of creating a work around by passing the value of some other form field named [id:naam] to a hidden field named [id: name] on submit of the last form. Oddly enough when I use fieldtype hidden, it wil let me use [id:name] which gave the default value 'testname'
So I wrote this function and placed it into my-functions.php:
function my_cforms_filter($POSTdata) {
## Yes a have 14 forms :), I checked the source and the last page
## has a submit button with id sendbutton14
if (isset($POSTdata['sendbutton14']) ) {
## 'namee' is the fieldname I require to have the value of 'naam'
$POSTdata['name'] = $POSTdata['naam'];
}
return $POSTdata;
}
The function doenst seem to work however, because it keeps submitting the old value 'testname' which I made default in the hidden field.
Anybody any idea how to tackle either of these 2 (make 'name' work bij default, or passing a value into it) problems?
Really love this plugin, this is really the only problem i've encoutered and i've made a pretty complicated forms :)
Thanks in advance,
Kind regards,
Stefan