I'd like to generate a random code to use as field, so I can storage it with the other values of the webform.

Is there a way to do this?

Comments

DanChadwick’s picture

Priority: Major » Normal
Status: Active » Fixed

As requested by the large STOP notice before you posted this new issue, support requests aren't Major.

The answer to your question is no, but if you can find a module that generates a random global token, you can use it as a default to a hidden component.

smurfxx’s picture

I'm sorry for the priority that I assigned!

I used the module "custom token" and created a system token that it's seen from any content of my drupal site except as default value of ANY component of Webform.

I can see my token in the /admin/help/token page, its name is [custom:randomticket] but I can't use that!

DanChadwick’s picture

Status: Fixed » Closed (duplicate)
Related issues: +#2339473: webform token removal interferes with other module markup

I believe this is the same issue as #2339473: webform token removal interferes with other module markup. Webform substittues the tokens that it knows about and removes any others so the use won't see [your-broken-token] in the output.

This is probably a problem because custom token hasn't done its substitutions yet.

See comment #13 in the related issue. Try changing 'clear' => TRUE to 'clear' => FALSE to see if that resolves your issue. Please post the results in the related issue, regardless of the outcome.

DanChadwick’s picture

I actually just tried this with the token_custom module and it seemed to work fine. Please re-open with step-by-step reproduction instructions. What is in '[custom:randomticket]' and how is it defined?

smurfxx’s picture

You're right! I was confused with an another site that use drupal, in the site where I want to use the token that was installed te 3.x version, I uninstalled that and installed the latest stable release, now everything is working, thank you very much and sorry!!!

DanChadwick’s picture

Status: Closed (duplicate) » Closed (cannot reproduce)
Related issues: -#2339473: webform token removal interferes with other module markup