• 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: [Solved] Pre-filled field by URL?

[Solved] Pre-filled field by URL? 16 years 10 months ago #3356

Is there any way to pre-fill a field by the way joomla links to the form?

I want to show the customer a (html)link on a products page to a generic form where the article number and name becomes pre-filled so the customer can concentrate on the other form options.

Is this possible?

Regards,

/Ola

Edit:
I got the following from Alex on support:
"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."

It works like a charm and also supports multiple variables in the url ("email=test@rsjoomla.com&fullname=Ola")

/O<br><br>Post edited by: ola.karlsson, at: 2008/06/19 20:30
Last Edit: 15 years 5 months ago by octavian.
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!