• 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: set default value from GET request

set default value from GET request 16 years 6 months ago #5488

Hello,

I need some fields will be filled from URL GET Request.

If the URL to the form is something as:
http://manou-laptop/joomla/index.php?option=com_forme&Itemid=34&fid=1&name=jm

The default value for a field will be $_GET

How do I make this ?

Thanks in advance
The administrator has disabled public write access.

Re:set default value from GET request 16 years 5 months ago #5493

Fixed,

Next script do this task:
foreach($fields as $i=>$field) {
  if($field->name == 'name') {
    $fields[$i]->default_value = $_GET['name'];
  }
}
The administrator has disabled public write access.

Re:set default value from GET request 16 years 5 months ago #5504

  • masgian
  • masgian's Avatar
  • OFFLINE
  • Fresh Boarder
  • Posts: 12
How do you use this scrip?
The administrator has disabled public write access.

Re:set default value from GET request 16 years 5 months ago #5505

Hello,

In the same way as the other scripts on the thread.

You are in Edit mode of your RSForm.
You go to Scripts TAB
You paste it in the box with title: Script called on form display

The key point, if you didn't realize, is that the URL of the form call is not the default one, you need to add the parameter you want to GET from the URL.

In my case, the default URL of the form preview is:
http://manou-laptop/joomla/index.php?option=com_forme&Itemid=34&fid=1
but I have changed to:
http://manou-laptop/joomla/index.php?option=com_forme&Itemid=34&fid=1&name=jm

So in my script i GET the parameter called 'name'.

I hope to have been well explained, if you need more information, detail it and I will try to clarify.

Regards,
The administrator has disabled public write access.

Re:set default value from GET request 16 years 5 months ago #5506

Hi, sorry... I think this post was in other thread ... there are no more script on it lol, hopefully I try to explained the way
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!