bug in webform: advanced settings: additional processing: the $form_values does not contain proper values
of user submitted data. The data are there, but not indexed by component name, e.g. $form_values['pos_oid'].
The data are accessible like this: $form_values['submitted']['1162403271'], where 1162403271 is 'cid' of that component.
Is this bug or am I missing something?

Comments

quicksketch’s picture

Status: Active » Closed (works as designed)

This is by design. Previously webform had a problem where single and double quotes where causing problems with form submissions. To correct the problem the form elements are all named by their component ids rather than their Title field. Ideally we'd use a system similar to CCK or Flexinode where the user can define a computer friendly name also. However, this is not a bug and doesn't currently have a timeline to change.

laken’s picture

Title: additional processing: the $form_values does not contain proper values » inability to designate field names in POST array hampers "redirect POST values" function

The feature that lets you redirect POST values to another URL is potentially extremely useful, particularly if you are creating forms to target pre-existing CGI scripts. BUT if you cannot designate the names of those fields in the POST array, you lose 95% of the value of that feature, because you need to alter those scripts to match the component id's the webform module has assigned for that form.

If you have control over the script you are submitting to you may be able to do that, but you will break any existing HTML forms that submit to that script. In my case, I want to make a webform to submit to a script on a system that I don't control, and which has a set, published POST api - I'm sure many others want to do the same thing. Without the ability to name the POST variables in my form to conform to that api, I am screwed.

If there were issues with quotes and such messing things up, that seems to be a validation issue that could be addressed in a different way. One way would be this: for each component I should be able to enter the label that would appear on the form presented to the user, as well as an optional POST variable name (which would undergo strict validation to catch troublesome characters) in case I'm using the "redirect POST values" option. That way people could enter their labels using whatever punctuation they need, and the variable names could be whatever is needed by the target script.

To sum up, it's hardly useful to have a "redirect POST values" feature if you can't designate the names of the POST variables.

What do you think?

laken’s picture

apologies for accidentally renaming this issue...

laken’s picture

Status: Closed (works as designed) » Active

bump

any thoughts on this?

goose2000’s picture

@alaken

You said it all I think. Pretty unusable right now. I do have control over my target scripts and will try to see if this works at all. What is misleading is that you are asked to name the form fields, then that is complete trashed by the dynamic stuff. You only figure this out by checking the HTML source.

Are there any other modules (like this) that can POST to a hosted external script? CCK?

goose2000’s picture

Did some more testing and this will work.

1 - only the hidden fields are sent to POST array.
2 - you will need to have control over the target page.
3 - you may encounter some 'headers already sent' errors, that can be over come.

I used a web testing tool to figure this out (badboy - free pretty good). Data will be sent
in [submitted] Arrays that you may need to dig through to get to the values you want.

quicksketch’s picture

Status: Active » Fixed

In webform 1.3 and higher, the keys used in the form are now user-definable. If no key is set, webform will default to the previous behavior. I hope this helps the crowd using webform as a form generator for external scripts.

goose2000’s picture

Hey thanks a bunch. I use Webforms to send POST data (from the profile module) to an external script that creates nice certificates in PDF format, your work here is completely unique for this functionality I think.

John

Anonymous’s picture

Status: Fixed » Closed (fixed)
Timbalord’s picture

Nothing really changed.

I am using webforms 1.4
The POST Var are now by my own and in the sourcecode they all got a pre word called submitted.

Instead vor surname now it looks like submitted[surname]. How can i redirect to a script that is not
my own and tells me how to name the vars?