• 1

Read this first!

We do not monitor these forums. The forum is provided to exchange information and experience with other users ONLY. Forum responses are not guaranteed.

However, please submit a ticket if you have an active subscription and wish to receive support. Our ticketing system is the only way of getting in touch with RSJoomla! and receiving the official RSJoomla! Customer Support.

For more information, the Support Policy is located here.

Thank you!

TOPIC: Passing a value into a form

Passing a value into a form 17 years 1 month ago #2566

  • rjray
  • rjray's Avatar
  • OFFLINE
  • Fresh Boarder
  • Posts: 1
Is it possible to pass a value into a form via the URL string.

I'm using jcal pro for an event calendar and would simply like to create a link on the calender event page that take someone to the register for the event page. There are too many event's to create a separate form for every event so what I would like to do is simply pass the value for a field into the form. Perhaps by creating a hidden field {event}.

This way I could create a simple URL link on the event page that takes them to the form say www.domain.com/index.php?option=com_form...=1&event=April19.
The administrator has disabled public write access.

Re:Passing a value into a form 16 years 10 months ago #3402

  • bertm
  • bertm's Avatar
  • OFFLINE
  • Fresh Boarder
  • Posts: 5
  • Thank you received: 1
It looks like this question is being asked in several different ways

www.rsjoomla.com/index.php/RSform-How-To...orm-fields.html#2745

and a slightly different angle in this post.

www.rsjoomla.com/index.php/RSform-How-To...s-in-forms.html#2492

I like the idea of passing parameters in a link, plus I think in my case grabbing the URL will also be necessary.

Any advice would be appreciated.

Thanks
The administrator has disabled public write access.

Re:Passing a value into a form 16 years 10 months ago #3414

I was on the same track in my question in this thread. I also raised a support ticket and got the following excellent response from Alex:

\"...you'll need to add a script in the Scripts called on form display. Here's how it should look like:
foreach($fields as $i=>$field){
    if(isset($_GET[$field->name])) $fields[$i]->default_value = $_GET[$field->name];
}

then try accessing

index.php?option=com_forme&fid=1&email=test@rsjoomla.com

Of course, you must have a field with id=email

Alex.\"

The script also works with multiple variables, just add more \"&(field id)=(field value)\" to the url.

/O
The administrator has disabled public write access.
  • 1

Read this first!

We do not monitor these forums. The forum is provided to exchange information and experience with other users ONLY. Forum responses are not guaranteed.

However, please submit a ticket if you have an active subscription and wish to receive support. Our ticketing system is the only way of getting in touch with RSJoomla! and receiving the official RSJoomla! Customer Support.

For more information, the Support Policy is located here.

Thank you!