• 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: free php variable

free php variable 14 years 7 months ago #8711

  • sylv20c
  • sylv20c's Avatar
  • OFFLINE
  • Fresh Boarder
  • Posts: 11
hello,
I have (in my joomla page) a session variable, i'd like to send his content in my form. In RS FORM I created a {hidden field} name : zeterrain.
in script form (Script called on form display ) :

$zeterrainvar = $_SESSION;

foreach($fields as $i=>$field){
if($field->name=='zeterrain'){
$fields[$i]->default_value = $zeterrainvar;
}

}

but in my form the value stay empty.

To test I'd try a simple :

foreach($fields as $i=>$field){
if($field->name=='zeterrain'){
$fields[$i]->default_value = "toto";
}

}

but it's empty too.

Can you see my error and help me please ?
thank in advance
The administrator has disabled public write access.

Re:free php variable 14 years 7 months ago #8715

  • sylv20c
  • sylv20c's Avatar
  • OFFLINE
  • Fresh Boarder
  • Posts: 11
nobody knows scripting ?
The administrator has disabled public write access.

Re:free php variable 14 years 5 months ago #9183

sylv20c wrote:
hello,
I have (in my joomla page) a session variable, i'd like to send his content in my form. In RS FORM I created a {hidden field} name : zeterrain.
in script form (Script called on form display ) :

$zeterrainvar = $_SESSION;

foreach($fields as $i=>$field){
if($field->name=='zeterrain'){
$fields[$i]->default_value = $zeterrainvar;
}

}

but in my form the value stay empty.

To test I'd try a simple :

foreach($fields as $i=>$field){
if($field->name=='zeterrain'){
$fields[$i]->default_value = "toto";
}

}

but it's empty too.

Can you see my error and help me please ?
thank in advance

I have successfully used two methods.

METHOD 1.

In the Form Manager, open your form and click the "Edit" symbol for your hidden field zeterrain.

In the "Default Value" box enter;

//<code>
$zeterrainvar = $_SESSION;
return $zeterrainvar;
//</code>

METHOD 2.

In the Form Manager, open your form and in script 2 (Script called on form process) enter:

$zeterrainvar = $_SESSION;
$_POST = $zeterrainvar;

$zeterrainvar will then be automatically saved into your hidden field.
The administrator has disabled public write access.

Re:free php variable 14 years 5 months ago #9195

  • alexp
  • alexp's Avatar
  • OFFLINE
  • RSJoomla! Official Staff
  • Posts: 2253
  • Thank you received: 180
Hello,

I think sylv20c is rather confused. The script that he describes seems to be designed for RSform! not RSform!Pro.
Please note: my help is not official customer support. To receive your support, submit a ticket by clicking here
Regards,
RSJoomla! Development Team
The administrator has disabled public write access.

Re:free php variable 14 years 3 months ago #9543

  • robnoon
  • robnoon's Avatar
  • OFFLINE
  • Fresh Boarder
  • Posts: 1
HI Did anyone work out how to do this in the end, tried these 2 scripts but did not work? are they designed for rsform not pro?

Thanks

Rob
The administrator has disabled public write access.

Re:free php variable 14 years 3 months ago #9547

  • andreic
  • andreic's Avatar
  • NOW ONLINE
  • RSJoomla! Official Staff
  • Posts: 733
  • Thank you received: 60
Hello,

Indeed the script is meant for RSform! not RSform!Pro, you see a couple of examples of auto-populating lists with RSform!Pro here:

Auto-populate list from a table:

http://www.rsjoomla.com/customer-support/documentations/34-custom-scripting/94-auto-populate-a-list-from-a-table.html


Auto-populate list with filenames from inside a folder:

http://www.rsjoomla.com/customer-support/documentations/34-custom-scripting/91-auto-populate-a-list-with-the-filenames-within-a-folder.html

You can see an example of auto-populating a field from Community builder here:

http://www.rsjoomla.com/customer-support/documentations/34-custom-scripting/371-autopopulate-a-field-from-community-builder.html
Please note: my help is not official customer support. To receive your support, submit a ticket by clicking here
Regards,
RSJoomla! Development Team
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!