• 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: Updated documentation for Form Display scripts?

Updated documentation for Form Display scripts? 9 years 8 months ago #32322

  • andrew88
  • andrew88's Avatar
  • OFFLINE
  • Fresh Boarder
  • Posts: 5
I'm trying to use the "Script Called on Form Display" and the documentation I'm working through doesn't appear to be working. Has the product changed since the documentation was written?

Specifically, I tried using this example and it doesn't work. I then tried a bit of testing and it appears that the $fields variable doesn't even exist (at least I can't get any script to recognize that the variable contains any data).

What I'm trying to do is create a form that changes based upon a GET variable. The form will function normally if you access it normally, but if you pass a custom variable in the URL it'll look very different.

I want certain fields to not display (so I need to be able to dynamically make some fields hidden), certain fields to pre-populate (so I need to be able to dynamically alter field info), and certain other information to display.

Is there better (or at least updated) documentation on HOW I can access form information? For example, at a minimum I'd like to know how to access field information since it appears $fields doesn't exist.

I could just make heavy use of regex and preg_replace directly with the $formLayout variable but that would be extremely cumbersome and prone to error.

Does anyone know where updated and more accurate documentation might be?
The administrator has disabled public write access.

Updated documentation for Form Display scripts? 9 years 8 months ago #32328

  • alexp
  • alexp's Avatar
  • OFFLINE
  • RSJoomla! Official Staff
  • Posts: 2253
  • Thank you received: 180
You are confusing RSForm!Pro with RSForm!. You are trying to apply an RSForm! script to RSForm!Pro. Given that these are two totally different extensions, scripts are not compatible.

You can prepopulate fields in RSForm!Pro through the Default value areas (of each field). Explanations provided here:

https://www.rsjoomla.com/support/documentation/rsform-pro/form-fields/textbox.html

Some examples available here:

https://www.rsjoomla.com/support/documentation/rsform-pro/customizing-rsform-pro/display-php-variables-by-default-when-form-is-shown.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.

Updated documentation for Form Display scripts? 9 years 8 months ago #32332

  • andrew88
  • andrew88's Avatar
  • OFFLINE
  • Fresh Boarder
  • Posts: 5
The issue is that I want to manipulate the fields, not just prepopulate them. I did figure out the prepopulation issue so that's good. But I also want to be able to modify the actual HTML of the form as it's being generated. So I want to be able to access the variables in the "Script Called on Form Display" but I can't seem to find any definitive documentation on that for RSForm!Pro

Is there a way I can find out what variables I can access? Specifically I want to be able to change the CSS class of fields based upon GET variables and to change the description/label of the field.

I know I can access the entire HTML and just do regex/preg_replace, but I was hoping to be able to access field info BEFORE that step because it would be extremely cumbersome otherwise.

The other option is to of course do this after the form is generated via JavaScript, but again that'd be cumbersome.
The administrator has disabled public write access.

Updated documentation for Form Display scripts? 9 years 8 months ago #32334

  • alexp
  • alexp's Avatar
  • OFFLINE
  • RSJoomla! Official Staff
  • Posts: 2253
  • Thank you received: 180
I am guessing that you are actually looking to populate the fields from within the Scripts called on form display area which is no possible (except via direct replacements).

All available variables are listed within the product documentation, per scripting area.
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.

Updated documentation for Form Display scripts? 9 years 8 months ago #32335

  • andrew88
  • andrew88's Avatar
  • OFFLINE
  • Fresh Boarder
  • Posts: 5
The only variable listed is $FormLayout

Is that the only variable available? I can't modify the fields at all (without using $FormLayout and doing something like preg_replace)?

I just want to make sure I understand that in RSForm (the non-professional version) I actually have MORE flexibility than in the paid professional version?
The administrator has disabled public write access.

Updated documentation for Form Display scripts? 9 years 8 months ago #32342

  • alexp
  • alexp's Avatar
  • OFFLINE
  • RSJoomla! Official Staff
  • Posts: 2253
  • Thank you received: 180
Each scripting area is explained within the product documentation. The article themselves list the variables that can be used and provide some basic examples.

Just because you can't provide default values through the Scripts called on form display area, doesn't mean that RSForm! is more flexible then RSForm!Pro. In RSForm!Pro you can do this via field Default value area as previously explained.
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.

Updated documentation for Form Display scripts? 9 years 8 months ago #32345

  • andrew88
  • andrew88's Avatar
  • OFFLINE
  • Fresh Boarder
  • Posts: 5
That didn't really answer my question. According to this
The administrator has disabled public write access.

Updated documentation for Form Display scripts? 9 years 8 months ago #32346

  • andrew88
  • andrew88's Avatar
  • OFFLINE
  • Fresh Boarder
  • Posts: 5
It seems you're not reading what I'm writing.

As I wrote earlier, I don't want to change the default values I want to modify the HTML of certain fields by adding CSS classes depending upon GET variables. So it has to happen during form display. In RSForm you had access to the $fields variable, but in RSForm!Pro you only have access to a giant HTML string in the form of $formLayout. That seems like there's a lot less flexibility.

Am I resigned to just using $formLayout (the only variable in the documentation) and writing complicated regex?
The administrator has disabled public write access.

Updated documentation for Form Display scripts? 9 years 7 months ago #32371

  • alexp
  • alexp's Avatar
  • OFFLINE
  • RSJoomla! Official Staff
  • Posts: 2253
  • Thank you received: 180
Yes, this is correct. You will have to use $formLayout.
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!