• 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: PHP in default value for text box

PHP in default value for text box 9 years 2 months ago #34314

  • hwd
  • hwd's Avatar
  • OFFLINE
  • Fresh Boarder
  • Posts: 3
Hi,

Im trying to get some data into the default value for a text box.

This data is already being displayed on the page that this form sits, and is being displayed with the following code.
<?php echo $this->company->businesscode?>
 

My question is, how can I get this into the default value for a a text box?

I have tried this in the default value, however it does not work.
<code>
<?php echo $this->company->businesscode?><?php } ?>
</code>

Any suggestions please ?

Thanks
Greg
The administrator has disabled public write access.

PHP in default value for text box 9 years 2 months ago #34316

  • alexp
  • alexp's Avatar
  • OFFLINE
  • RSJoomla! Official Staff
  • Posts: 2253
  • Thank you received: 180
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.

PHP in default value for text box 9 years 2 months ago #34328

  • hwd
  • hwd's Avatar
  • OFFLINE
  • Fresh Boarder
  • Posts: 3
I've read those pages, which were of no help.

I can get it to work, sort of.

This works to pull page title in...( a workaround for me)
//<code>
$doc = JFactory::getDocument();
return $doc->getTitle();
//</code>

However, my question was about php echo, which I cannot get to work at.

Tried this (which does not work)...
//<code>
<?php echo $this->company->businesscode?><?php } ?>
//</code>

Anyway done this with php echo ?

Thanks Greg
The administrator has disabled public write access.

PHP in default value for text box 9 years 2 months ago #34334

  • alexp
  • alexp's Avatar
  • OFFLINE
  • RSJoomla! Official Staff
  • Posts: 2253
  • Thank you received: 180
That's the point, you should not echo the result in that particular field, but return the value (as per provided examples). Further to this, you shouldn't use PHP tags in any of the RSForm!Pro scripting areas.

PS: I doubt your script would work, as it assumes that by the time the script is triggered, the variable you are trying to echo is already initialized.
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!