• 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: using php in default values doesn't work

using php in default values doesn't work 11 years 8 months ago #24445

  • holmesg
  • holmesg's Avatar
  • OFFLINE
  • Fresh Boarder
  • Posts: 6
I want to grab some GET variables and put them into some form fields. I've googled and found scripts to do this. I've tried putting them into the default values for the fields, complete with the //<code> tags, but it doesn't work. The form display just shows the script.

e.g.

/<code>
$myparameter_value = JRequest::getVar('myparameter');
return $myparameter_value;
//</code>

Help?
The administrator has disabled public write access.

using php in default values doesn't work 11 years 8 months ago #24446

This most is most likely happening because of a missing '/' character on the first line. Please add the missing character and try again.

For more information please refer to the following article from our documentation:

www.rsjoomla.com/support/documentation/v...can-i-catch-it-.html

PS: Please keep in mind that we offer a solution for the most common scripting requests in our documentation:

www.rsjoomla.com/support/documentation/view-knowledgebase.html

... either under the "Frequently asked questions" or the "Custom Scripting" sections.
Please remember that my responses aren't considered customer support, to receive customer support please submit a new customer support ticket, and we will gladly assist you.

Best Regards,
Cristian Nicolae.
The administrator has disabled public write access.

using php in default values doesn't work 11 years 8 months ago #24447

  • holmesg
  • holmesg's Avatar
  • OFFLINE
  • Fresh Boarder
  • Posts: 6
That was just a copy paste error. The actual code I am trying has the correct format.

It is just outputting the code right into the form display (the browser hides the code tag, of course).

Here what is appearing in the HTML source for the page:

//<code>
$myparameter_value = JRequest::getVar('ref');
return "Bid Opportunity - #" . $myparameter_value;
//</code><div class="formClr"></div></td>
<td></td>
</tr>
<tr class="rsform-block rsform-block-description">
<td></td>
<td>//<code>
$myparameter_value = JRequest::getVar('desc');
return $myparameter_value;
//</code>


Here's what I actually used:

In one field:
//<code>
$myparameter_value = JRequest::getVar('ref');
return "Bid Opportunity - #" . $myparameter_value;
//</code>


In another:
//<code>
$myparameter_value = JRequest::getVar('desc');
return $myparameter_value;
//</code>
The administrator has disabled public write access.

using php in default values doesn't work 11 years 8 months ago #24448

  • holmesg
  • holmesg's Avatar
  • OFFLINE
  • Fresh Boarder
  • Posts: 6
Does the license key have to be entered for this to work?

If so, how can I develop it on a development site?
The administrator has disabled public write access.

using php in default values doesn't work 11 years 8 months ago #24450

www.rsjoomla.com/forum/37-rsform-pro/223...esnt-work.html#24446

No you don't need to have the license key entered, in the case of RSForm!Pro you will only need the license key for updates.

In this case you will need to update your RSForm!Pro installation to the latest version. Please refer to the following article for details:

www.rsjoomla.com/support/documentation/v...a-newer-version.html

If this issue persists after the updates, please submit a tech support ticket:
www.rsjoomla.com/submit-a-ticket.html
Please remember that my responses aren't considered customer support, to receive customer support please submit a new customer support ticket, and we will gladly assist you.

Best Regards,
Cristian Nicolae.
Last Edit: 11 years 8 months ago by cristian.nicolae.
The administrator has disabled public write access.

using php in default values doesn't work 11 years 8 months ago #24452

  • holmesg
  • holmesg's Avatar
  • OFFLINE
  • Fresh Boarder
  • Posts: 6
I'm not sure if my company wants to update this extension just now, at least not for this site. Like most, we are afraid of breakling things, etc., and we are about to launch this site :)


Is there a way of accomplishing the task - push a GET value into a form field - in a form display script? Or will that not work in 1.4.0 either?
The administrator has disabled public write access.

using php in default values doesn't work 11 years 8 months ago #24470

  • holmesg
  • holmesg's Avatar
  • OFFLINE
  • Fresh Boarder
  • Posts: 6
OK, I upgraded RSForm Pro to the latest version. And trying to use PHP in the default text for a field still does not work. It just outputs the code to the page.

Help? What should I try here?
The administrator has disabled public write access.

using php in default values doesn't work 11 years 8 months ago #24480

  • holmesg
  • holmesg's Avatar
  • OFFLINE
  • Fresh Boarder
  • Posts: 6
Anyone? Why doesn't this work? It just outputs the code to the page. Latest version of RSForm Pro.
The administrator has disabled public write access.

using php in default values doesn't work 11 years 8 months ago #24486

  • octavian
  • octavian's Avatar
  • OFFLINE
  • RSJoomla! Official Staff
  • Posts: 783
  • Thank you received: 110
Hello,
As my colleague said, please submit a ticket to receive customer support. This is not something that can be solved through a forum post.
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.

using php in default values doesn't work 11 years 8 months ago #24491

  • register
  • register's Avatar
  • OFFLINE
  • Fresh Boarder
  • Posts: 4
I opened a ticket and was quickly shown a workaround. Thanks.
The administrator has disabled public write access.

using php in default values doesn't work 8 years 1 month ago #36686

  • edkiefer
  • edkiefer's Avatar
  • OFFLINE
  • Fresh Boarder
  • Posts: 3
Is the php script area where I put google tag code?
Script called after form has been processed
The $thankYouMessage string contains the HTML code of the Thank You Message.
You can modify it by adding a PHP script below. Remember to not include the <?php and ?> tags.
This is the code I need to put in to track after form is processed:
ga('send', 'event', [contactus], [submit], [weekendwarrior], [1], [fieldsObject]);
The administrator has disabled public write access.

using php in default values doesn't work 8 years 4 weeks ago #36691

  • edkiefer
  • edkiefer's Avatar
  • OFFLINE
  • Fresh Boarder
  • Posts: 3
Can anyone answer this question?
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!