cforms II User Forum

Registration is currently disabled.
Guest

FAQs

Login form protected by Login LockDown.


Lost password?
Advanced Search

— Forum Scope —

  

— Match —

   

— Forum Options —

    

Wildcard usage:
*  matches any number of characters    %  matches exactly one character

Minimum search word length is 4 characters - maximum search word length is 84 characters

Topic RSS
REGISTER A RANDOM NUMBER WITH FORMDATA
October 10, 2012
8:43 pm
Theodoro
Guest

Hello,

How I can show a random number and save this number in data bank together with formdata?

We made a survey and the user have this number for a raflle?

Anyone give me an example, a link? Thanks

October 12, 2012
3:44 pm
Oliver
Munich, Germany
Admin
Forum Posts: 6400
Member Since:
March 6, 2005
Offline

You could use the dynamic form feature and create the form via PHP (see Help page for examples).

This way you can add a PHP generated random value to a hidden field.

October 16, 2012
3:52 pm
Theodoro
Guest

Hi Oliver,

Thanks for your reply and help…sf-smile
Well I use your tips (php random and a hidden field), works!  I use a visible field with readonly because the user need see the random numbers… sf-wink
Now I try understand dynamic form feature…

I need to create a custom table in DB for collect the answers?

October 16, 2012
3:55 pm
Theodoro
Guest

Oh! By the way, how define the DB in form submit?

October 21, 2012
7:10 pm
Oliver
Munich, Germany
Admin
Forum Posts: 6400
Member Since:
March 6, 2005
Offline

Theodoro said
Hi Oliver,

Thanks for your reply and help…sf-smile
Well I use your tips (php random and a hidden field), works!  I use a visible field with readonly because the user need see the random numbers… sf-wink
Now I try understand dynamic form feature…

I need to create a custom table in DB for collect the answers?

No, not needed. The DB will take your custom fields and save those in reference to the form # you have associated this dynamic form with. 

Forum Timezone: Europe/Berlin

Most Users Ever Online: 959

Currently Online:
42 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: 3741

Members: 1463

Moderators: 3

Admins: 2

Forum Stats:

Groups: 1

Forums: 4

Topics: 5341

Posts: 18708

Newest Members: juredujmovic, dreamkeeper, rajattyagi, wrokaa, lukass

Moderators: Paul (421), cnymike (8), sonika (95)

Administrators: Oliver (6400), Nicky (3)