Hot answers tagged

3

So you are counting all submissions 1 user has and you want to display that message when the user has 30, 60, 90, ... submissions? That doesn't make much sense to me but the solution would be to change if ($counter = $max){ to if ($counter % $max == 0) { In computing, the modulo operation finds the remainder after division of one number by another ...


3

You need to enter the following into the 2nd textarea in the form properties tab under "PHP Scripts": $formId = 0; // CHANGE THIS VALUE to your form ID $db = JFactory::getDbo(); $query = $db->getQuery(); $query ->select("*") ->from("__rsform_submission_values") ->where("FormId = " . $db->q($formId)) ->where("FieldValue = "...


3

Below are 2 options: 1. Display the form within Joomla Article. The first one is to inject and publish the form within a joomla article, where the cloaking plugin will be triggered. RS Form component comes with the required plugin that allows to show a form within an article. However this might cause further issues with how the form will deal any other ...


2

Your URL is wrong, it should only contain one question mark (?option=com_rsform). Subsequent URL parameters must start with &. Try http://www.trebonlazne.cz/cs?option=com_rsform&formId=13&form[vyberte_vami_zvoleny_pobyt]=mail@domain.com, it should work. From the tutorial you mentioned: IMPORTANT: If the parameter you are adding is the first ...


2

First, be sure the jQuery library is being loaded. Using the browser developer tools inspect the rendered head and verify it is being loaded. If not, you will need to load either from your template, or by doing a template override for the component view handling the page rendering in question. Either way, you'll need to add the following to the top. ...


2

You could try using a plugin called Simple Pop-Up. It's a plugin that will display anything between {simplepopup} tags in a modal popup. The tags can be added to articles, modules or basically any part where the content can be processed by plugins. The plugin can be configured to load only once for each user. I haven't tested this, but if your form is ...


2

I would personally stay away from cookies in this instance, as they can be deleted from the browser. Instead, you would be better off (If the user must be logged in first): Creating a database table with a column called user_id Write a database query that gets executed once the form has been filled in and add the user ID to the user_id column in the ...


2

You actually don't need to perform multiple joins with the same table to gather your desired results. What is best suited is a "pivot" technique. There is no cleaner way to deal with rsform's submission data. Please note, while you may only have one "form" in your #__rsform_submissions table, it would be more robust to specify the FormId in the WHERE ...


2

Solved this, so posting this answer for anyone who comes across the same problem in the future. So, what happens is: After posting the form, a script is supposedly kicked off, similar to what happens with this plugin: https://www.rsjoomla.com/blog/view/415-rsformpro-ideal-plugin-launched.html This is a script that is nowhere to be found in site ...


2

You can use the enqueueMessage function to display a message in the system output section. In the code you've provided, you will see the following: $mainframe->redirect(JRoute::_('index.php?option=com_rsform&view=directory&Itemid='.$itemId_value, false)); Replace it with the following: $mainframe->redirect(JRoute::_('index.php?option=...


2

The RSForm!Pro - Google Analytics Plugin is used to register posted forms in Google Analytics. It triggers a specific code on the thankyou page or thankyou message. With the plain Google Analytics code you would not be able to check if someone has filledin the form when you use the thankyou message. Because that would register the same page as the page ...


2

Try doing below stuff if you are using mysql: after you connect to the mysql, do this query to make sure that you are using UTF8: mysql_query("SET NAMES 'utf8'"); mysql_query("SET CHARACTER SET 'utf8'"); Also make sure you are using right encoding in your html head <meta http-equiv="content-type" content="text/html; charset=UTF-8"> If this does ...


2

Here is what I believe the mySQL query to be with (1,2,3) substituted in for your imploding of results because I wanted to check the mySql syntax of it. I don't have time to convert into PHP right now, but wanted to try to help. If it doesn't work, let me know in comments and I will try to adjust:SELECT a.FieldValue as Container, b.FieldValue as ...


2

There's no generic answer to the question because the code that sits between a form submission and a database table varies wildly from application to application. Perhaps more importantly, different applications will react differently if you add code to interfere with the way the data is stored and retrieved. That being said, if it is mission critical to ...


2

It is best practice to minimize the number of calls to the database. Your logic in your two queries can be merged into one like this: try { $db = JFactory::getDbo(); $query = $db->getQuery(true) ->select("a.FieldName, a.FieldValue") ->from("#__rsform_submission_values a") ->innerJoin("#...


1

Yes, your queries can certainly use refactoring. Using two separate calls on the same table is asking MySQL to do needless extra work. To convert your queries into plain English, you want to: create a result set of containertype1 values sorted by SubmissionId for each SubmissionId from FormId 28 including only submissions that contain a Status1 value of ...


1

As a matter of good coding practice, I recommend that you DRY out your code (Don't Repeat Yourself) ...I'm talking "super-dehydrate" like this: echo "<div class=\"user_avatar" , ($userNameEffects == 1 ? "_rotate avatar$column" : "") , "\" style=\"background-image:url('"; if ($useGravatar && $item->jux_gravatar) { echo $item->...


1

I haven't tried to do it, but most likely the edit/submissions layout of RSForm pro would be improvable. It should support template overrides and also you should be able to apply CSS changes to fine-tune it's look. Regarding sending emails when there is a change in the form I guess you need to ask RSJoomla. Logically there should be a way using some php. ...


1

Fabrik is pretty awesome for things like that. You can totally customize the look of any form created in Fabrik.


1

Thanks for your answer This worked perfectly: <script> document.addEventListener('DOMContentLoaded', function(){ document.getElementById('photo').innerHTML = '<img src="'+ document.getElementById('fieldname').value +'" alt="Image" />'; }); </script> Enter this in the script section of your form and disable the auto layout generation in ...


1

You should be able to do this with PHP using the "Scripts called on form display" section. The basic steps would be: Set variable to the image path you are passing (ie $_GET, etc) Set variable to the placeholder image value Do a find/replace using the syntax below: $formLayout = str_replace($find,$replace,$formLayout);


1

I think you can do this in a much simpler way. In the HTML Layout of the second form, set "Auto Generate Layout" to "No". Then, add the following to the very beginning of the HTML: <a name="#form-2"></a> In your first form, just ensure that it redirects to the following URL: link-to-your-second-form#form-2


1

Here you are: $query->select($db->qn('s.SubmissionId','id')) ->select($db->qn('s.DateSubmitted','date')) ->select($db->qn('sv.FieldValue','status')) ->select($db->qn('nv.FieldValue','name')) ->select($db->qn('ev.FieldValue','email')) ->from($db->qn('#__rsform_submissions','s')) ...


1

Try to change it to: "+$dt days" Also, I may be wrong but, I believe you must provide dates in correct order as if dates diff is <0 then it would return 0 which corresponds to 01/01/1970


1

To solve a similar request, I have implemented Chained Selects Plugin. <select id="mark" name="mark"> <option value="">--</option> <option value="bmw">BMW</option> <option value="audi">Audi</option> </select> <select id="series" name="series"> <option value="">--</option> <option ...


1

In Joomla, forms have a session token to prevent CSRF. Cross-Site Request Forgery (CSRF) is a type of attack that occurs when a malicious Web site, email, blog, instant message, or program causes a user's Web browser to perform an unwanted action on a trusted site for which the user is currently authenticated. If you submit information from Ajax, you ...


1

You can pre-fill RSForm fields using URL parameters, there's a good guide available here. According to the guide this won't work on hidden fields, though: Note: This syntax will not work for hidden fields. In such cases you can either, use the last method from this article or use a regular textbox which can be hidden through inline CSS by adding style="...


1

You can do this by creating a hidden field in RS Form and in its default value field insert a code as below: //<code> $jinput = JFactory::getApplication()->input; return ($jinput->get('id', 'No K2 Item', 'INT')); //</code> Your hidden field will be sending the K2 Item's id, assuming you are only using it inside K2 items, with each ...


1

All you need to do is write a database query. I would suggest importing the Joomla API and writing a Joomla styled query like so: $fullName = $_POST['fullName']; $emailAddress = $_POST['emailAddress']; $worksInPub = ($_POST['workInPub']==='true'); $isSupplier = ($_POST['isSupplier']==='true'); $isOver18 = ($_POST['isOver18']==='true'); $db = ...


1

Not sure how RSForm!Pro shows an errors message, but I assume there is a pre-defined HTML element with a class that is set to display: block if there is an error. So what I would suggest doing is, make the error appear, then inspect the error element and check for any classes, then you can use the following jQuery: jQuery(document).ready(function($){ ...


Only top voted, non community-wiki answers of a minimum length are eligible