• 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: Issue with rsform phpscript called on form display

Issue with rsform phpscript called on form display 11 years 5 months ago #25811

There are 2 buttons in my rsform, and I need its availability as the value in database so I have written the following code in php script called on form display:
$db = JFactory::getDBO();

$query = "SELECT dropbox_state FROM #__dropbox WHERE id=1";
$db->setQuery($query);
$result = $db->loadResult();
if($result == '0')
{
$content = "jQuery(document).ready(function() {
document.getElementById('delete_connection').style.display='none';
document.getElementById('connect').style.display='block';
});";
}
else
{
$content = "jQuery(document).ready(function() {
document.getElementById('delete_connection').style.display='block';
document.getElementById('connect').style.display='none';
});";
}
$document = JFactory::getDocument();
$document->addScriptDeclaration($content);

It works well when I access the form with its url like index.php?option=com_rsform_blahblah but the issue is when I place this rsform in an article with {rsformid} in its content, this code does not affect. Is there any solution for it?
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!