Does anyone know how to use OpenLayers CCK fields with the form API? I want to get a coordinate and some other data from users in my custom form.

  • Hello Raoof, and welcome on Drupal Answers. Where is your custom form used? Does it have a node reference? – kiamlaluno Apr 17 '11 at 11:54
  • thank you and sorry for my English :) . no it doesn't have any node reference. actually I'm new to drupal and I want to create a database-driven website that gather lots of data from users and displaying that data in a map, I use Form API to create my own tables and do not want to mixing them with nodes. what do you mean by "Where is your custom form used" ? – Raoof Apr 17 '11 at 14:38
  • I mean, are you adding some form fields in a node edit form, or are you creating a custom form in a different page? In the latter case, how do you get the node ID for which the form would show the coordinates? – kiamlaluno Apr 17 '11 at 15:06
  • I'm creating custom form in a different page – Raoof Apr 17 '11 at 20:00
  • 1
    How you do get the node ID? – kiamlaluno Apr 17 '11 at 20:05

I believe in this case you want to create a new content type with the appropriate cck fields to collect the location data. This will be much, much easier than trying to recreate the same experience with the forms api, custom tables and some custom module to integrate CCK fields.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.