• 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: Script for assigning variable value to a field?

Script for assigning variable value to a field? 17 years 1 month ago #2838

I've got 3 forms on a site that are basically the same except for a single-word identifier that could be hidden from the user. I'd like to use the same form for all three instances, but pass the identifier to the form through the URL that calls the form.

Could you please suggest a script that I can use for a hidden field so that the field value gets set to the variable passed through the URL?

Thanks,

Jim
The administrator has disabled public write access.

Re:Script for assigning variable value to a field? 17 years 1 month ago #2842

I was successful using this code in the form display script:

$variable = $_GET('variable');
global $mainframe;
foreach($fields as $i=>$field){
if($field->name=='variable'){
$fields[$i]->default_value = $variable;
}
}

I also created a new, hidden field called \"variable\" on the form.

Jim
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!