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 Related Topics
Passing arguments to a form or adding an extra field with php
Trying to pass a user defined ID value to a hidden field of an existing form.
September 7, 2012
5:57 pm
bob52
Guest

Hi,

I need to create forms with user defined id as hidden fields. One possible solution is to create a form for every ID, but that seems like a bad idea since there could be 20, 50, 100 ID's and hence that many forms.

Another solution is to pass the ID value to an already created form, which will somehow be caught by the ID hidden field created in the form. Although, I am not sure if this is currently possible?

Another solution will probably be to grab the already defined fields in the created form and reconstruct them with the addition of the ID hidden field and the value, using the insert_custom_cform functions.

My questions are:
1. Is it possible to pass values to an already existing form?
2. Could an already existing form be reconstructed using the insert_custom_cform function?
3. Do you have any suggestions on how to approach this problem?

If there are other possible solutions, I would be happy to hear them.

Thank you!

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

bob52 said
Hi,

I need to create forms with user defined id as hidden fields. One possible solution is to create a form for every ID, but that seems like a bad idea since there could be 20, 50, 100 ID's and hence that many forms.

yup

Another solution is to pass the ID value to an already created form, which will somehow be caught by the ID hidden field created in the form. Although, I am not sure if this is currently possible?

it is. you could pass it on via the link that point to the page with the form:   page?hiddenID=123

Another solution will probably be to grab the already defined fields in the created form and reconstruct them with the addition of the ID hidden field and the value, using the insert_custom_cform functions.

My questions are:
1. Is it possible to pass values to an already existing form?

yes, see above

2. Could an already existing form be reconstructed using the insert_custom_cform function?

yes, but it'll be more coding work

3. Do you have any suggestions on how to approach this problem?

you could add an empty hidden field and use my_cforms_filter() in my-functions.php to set the ID at run-time in $track[...]

If there are other possible solutions, I would be happy to hear them.

Thank you!

Forum Timezone: Europe/Berlin

Most Users Ever Online: 959

Currently Online:
22 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: 3763

Members: 1463

Moderators: 3

Admins: 2

Forum Stats:

Groups: 1

Forums: 4

Topics: 5359

Posts: 18742

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

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

Administrators: Oliver (6400), Nicky (3)