Passing URL parameters to a new entry

Passing URL parameters to a new entry

by Roger Mepham -
Number of replies: 7

Hi

I'm using face2face to allow delegates to sign up to a course and then automatically taking them to a new dataform to capture more information like payment details etc.

Is there an easy way to pass name=value pairs in a new dataform entry URL?

I'm using http://moodlesite/mod/dataform/view.php?d=32&view=36&editentries=-1 to enter a new form and it would be excellent if I could append extra values to the URL and have them populate some dataform fields automatically.

i.e. http://moodlesite/mod/dataform/view.php?d=32&view=36&editentries=-1&course=48 so that a field called course had "47" entered automatically.

Many thanks for any assistance or suggestions smile

Roger

Average of ratings: -
In reply to Roger Mepham

Re: Passing URL parameters to a new entry

by Itamar Tzadok -

With default field content, we should distinguish between content the user can change in the form and content the user cannot change. Some fields support the former via the field settings. But such default content is not per view. The latter kind of default content, or rather predefined content, is not yet possible but is already in the wish list and I'm experimenting with some approaches.

For some applications where you want to categorise entries and you don't have too many categories, you can use a radio button field with one option, for each category. The trick is that when you set the field's single option as the field's default content, it opens in the form as selected and cannot be unselected and hence will be saved in the entry as set. Then you can create a designated views for adding the categorized entries such that each view contains the respective category (radiobutton) field.

hth smile

In reply to Itamar Tzadok

Re: Passing URL parameters to a new entry

by Stan Klapauszak -

Hi Itamar


I was interested in a very similar problem - providing predefined content to a Dataform or Database. Do you anticipate this being added to the Dataform plugin in the near term, or is it years in the future? That will help determine how we pursue this question...


Thanks,

Stan

In reply to Stan Klapauszak

Re: Passing URL parameters to a new entry

by Itamar Tzadok -

Do you mean, creating entries with some of the content predefined? smile

In reply to Itamar Tzadok

Re: Passing URL parameters to a new entry

by Stan Klapauszak -

Exactly - at various points throughout a course we want to create new rows in a database with some fields user-input but others pre-filled with data. That pre-filled data isn't fixed, but varies depending on where they are in the course.

Stan

In reply to Stan Klapauszak

Re: Passing URL parameters to a new entry

by Itamar Tzadok -

Can you open a feature request in the Set: Dataform tracker and add some more details how this might work? smile

In reply to Itamar Tzadok

Re: Passing URL parameters to a new entry

by Stan Klapauszak -

Itamar - I have created a request https://tracker.moodle.org/browse/MDL-52505 with some additional details. If you need further please ask.

Stan