• 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: How to popup a form?

How to popup a form? 9 years 3 months ago #29935

Hi all,

I'm sorry but I'm a newbye trying to find out how to popup a form.

I've been looking for in the forum and documentation and I just found this article.

The point is that following the first step, I should insert the code <?php JHTML::_('behavior.modal'); ?> in the <head> tag of the index.php file located in my template folder. But such file doesn't have a <head> tag.
<?php
/**
 * ------------------------------------------------------------------------
 * JA Nuevo template
 * ------------------------------------------------------------------------
 * Copyright (C) 2004-2011 J.O.O.M Solutions Co., Ltd. All Rights Reserved.
 * @license - Copyrighted Commercial Software
 * Author: J.O.O.M Solutions Co., Ltd
 * Websites:  http://www.joomlart.com -  http://www.joomlancers.com
 * This file may not be redistributed in whole or significant part.
 * ------------------------------------------------------------------------
 */
 
// no direct access
defined('_JEXEC') or die;
 
//check if t3 plugin is existed
if (!defined('T3')) {
	if (JError::$legacy) {
		JError::setErrorHandling(E_ERROR, 'die');
		JError::raiseError(500, JText::_('T3_MISSING_T3_PLUGIN'));
		exit;
	} else {
		throw new Exception(JText::_('T3_MISSING_T3_PLUGIN'), 500);
	}
}
 
$t3app = T3::getApp($this);
 
// get configured layout
$layout = $t3app->getLayout();
 
$t3app->loadLayout($layout);

I'm using a Joomlart's template called JA Nuevo. So, any advice on how to popup a form from a article will be very, very appreciated

Thanks in advance

JOan
The administrator has disabled public write access.

How to popup a form? 9 years 3 months ago #29941

  • cosmin.cristea
  • cosmin.cristea's Avatar
  • OFFLINE
  • Platinum Boarder
  • Posts: 756
  • Thank you received: 144
If you want to pop it up from a modal window, assuming that the template is using standard bootstrap classes for modals you can do it like this :

Step-1 : Install RSForm! Pro system plugin (can be found in the download section of the component)
Step-2 : Create an article/custom HTML module and insert the following code:

- If you have bootstrap 3 loaded:
<!-- Button trigger modal -->
<button type="button" class="btn btn-primary btn-lg" data-toggle="modal" data-target="#myModal">
  Launch demo modal
</button>
 
<!-- Modal -->
<div class="modal fade" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
  <div class="modal-dialog">
    <div class="modal-content">
      <div class="modal-header">
        <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
        <h4 class="modal-title" id="myModalLabel">My Form</h4>
      </div>
      <div class="modal-body">
        {rsform id_of_form}
      </div>
      <div class="modal-footer">
        <button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
        <button type="button" class="btn btn-primary">Save changes</button>
      </div>
    </div>
  </div>
</div>

Or if your template is built on bootstrap 2 version use the following code:
<!-- Button to trigger modal -->
<p><a class="btn" href="#myModal" data-toggle="modal">Launch demo modal</a></p>
<!-- Modal -->
<div id="myModal" class="modal hide fade" tabindex="-1">
<div class="modal-header"><button class="close" type="button" data-dismiss="modal">×</button>
<h3 id="myModalLabel">My Form</h3>
</div>
<div class="modal-body">{rsform id_of_form}</div>
<div class="modal-footer"><button class="btn" data-dismiss="modal">Close</button> <button class="btn btn-primary">Save changes</button></div>
</div>

Step-3: publish the article/module wherever you need it, upon clicking the button, standard Bootstrap modal window will popup.

Try it and let me know!
My help is not official customer support. To receive your support, submit a ticket by clicking here
The administrator has disabled public write access.
The following user(s) said Thank You: webcat-solutions, gregs

How to popup a form? 8 years 9 months ago #31772

Hi,

I have integrated same as rsform in bootstrap modal window. After Submission popup automatically close. So if i need to see the Thank you message i need to click the modal button again. How can i show the thank you message in bootstrap modal window with out auto closing.

Thanks
Arun
The administrator has disabled public write access.

How to popup a form? 8 years 9 months ago #31816

  • cosmin.cristea
  • cosmin.cristea's Avatar
  • OFFLINE
  • Platinum Boarder
  • Posts: 756
  • Thank you received: 144
You can achieve this by placing a script to open the modal in your thank you message. For the above mentioned script (if you are using Bootstrap2), you should do this:
// Wait for document to be ready
jQuery(document).ready(function(){
  // Select the modal and toggle it like this:
  jQuery('#myModal').modal();
});

should work!
My help is not official customer support. To receive your support, submit a ticket by clicking here
The administrator has disabled public write access.
The following user(s) said Thank You: webcat-solutions

How to popup a form? 8 years 8 months ago #32157

Hi,

I'm trying to add a RS FORMS to a Bootstrap modal popup and used your code example but it wouldn't work. I'm using Joomla 3.4.3 with Bootstrap3.

How to call the correct RS FORMS id?

Your code mentioned:

<h4 class="modal-title" id="myModalLabel">My Form</h4>
</div>
<div class="modal-body">
{rsform id_of_form}
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
<button type="button" class="btn btn-primary">Save changes</button>

I see {rsform id_of_form} but with entering the ID the form doesn't show up. Probably a newby questions but I hope someboby can help me.

Is there a code example available?

Thanks!
The administrator has disabled public write access.

How to popup a form? 8 years 8 months ago #32160

  • alexp
  • alexp's Avatar
  • OFFLINE
  • RSJoomla! Official Staff
  • Posts: 2253
  • Thank you received: 180
Make sure you have installed (and enabled) the RSForm!Pro Content plugin.
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.
The following user(s) said Thank You: Macroscoop

How to popup a form? 8 years 8 months ago #32162

Bummer - No, it wasn't enabled but afer enabling, it still doesn't work. Here is the code I used:

<!-- Button trigger modal --> <button class="btn btn-primary btn-lg" type="button" data-toggle="modal" data-target="#myModal"> Launch demo modal </button> <!-- Modal -->
<div id="myModal" class="modal fade" tabindex="-1">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header"><button class="close" type="button" data-dismiss="modal">×</button>
<h4 id="myModalLabel" class="modal-title">My Form</h4>
</div>
<div class="modal-body">{rsform 4}</div>
<div class="modal-footer"><button class="btn btn-default" type="button" data-dismiss="modal">Close</button> <button class="btn btn-primary" type="button">Save changes</button></div>
</div>
</div>

The Modal shows up but without rs form - only the {rsform 4} as text.
The administrator has disabled public write access.

How to popup a form? 8 years 8 months ago #32170

  • alexp
  • alexp's Avatar
  • OFFLINE
  • RSJoomla! Official Staff
  • Posts: 2253
  • Thank you received: 180
Please empty the site related cache and try again. If the issue persists, please try using the RSForm!Pro System plugin instead (same syntax will be used).

PS: Disable the content plugin once you have enabled the system one.
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.
The following user(s) said Thank You: Macroscoop

How to popup a form? 8 years 8 months ago #32175

Thanks, it works !
The administrator has disabled public write access.

How to popup a form? 8 years 8 months ago #32176

Last question.. (hopefully) The RSForm opens perfectly in the Modal popup but after submitting the modal closes and after pushing the bootstrap button again - the thanks you screen will be shown. I noticed a short java script (based on bootstrap 2)

// Wait for document to be ready
jQuery(document).ready(function(){
// Select the modal and toggle it like this:
jQuery('#myModal').modal();
});

But does this also works for bootstrap3 and could you please let me know where to add this short part of java code? Does I need to put that in the RSFORMS part?

Thanks for the support so far !
The administrator has disabled public write access.

How to popup a form? 8 years 8 months ago #32181

Hi,

The javascript for the thank you page is working perfect. Only when the visitor enters wrong information and submits the information the Modal closes. When you press the bootstrap button to open the form - the form opens again but with the red validation errors. Is there additional javascript available which respects the RS FORM validation?

<script>jQuery(document).ready(
function(){
jQuery('#myModal').modal(); });
</script>

Joomla 3.4.3
RS FORMS Pro
Last Edit: 8 years 8 months ago by Macroscoop.
The administrator has disabled public write access.

How to popup a form? 7 years 1 month ago #36583

Trying to use this as well for my site, but it seems that the modal closes instantly after it loads without any other button pushes. Any ideas?
<!-- Button trigger modal -->
<button type="button" class="btn btn-primary btn-lg" data-toggle="modal" data-target="#myModal">
  Launch demo modal
</button>
 
<!-- Modal -->
<div class="modal fade" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
  <div class="modal-dialog">
    <div class="modal-content">
      <div class="modal-header">
        <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
        <h4 class="modal-title" id="myModalLabel">My Form</h4>
      </div>
      <div class="modal-body">
        {rsform 3}
      </div>
      <div class="modal-footer">
        <button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
        <button type="button" class="btn btn-primary">Save changes</button>
      </div>
    </div>
  </div>
</div>
The administrator has disabled public write access.

How to popup a form? 7 years 1 month ago #36659

  • pcproffitt
  • pcproffitt's Avatar
  • OFFLINE
  • Fresh Boarder
  • Posts: 2
  • Thank you received: 1
I'm having the same issue where the modal window is opening and displaying the form, but it then immediately closes. Joomla 3.6.5 and RSForm! Pro 1.52.4. I'm using a RocketTheme template in case it matters. I've just copied the example code here and used it as is for testing.
The administrator has disabled public write access.

How to popup a form? 6 years 9 months ago #37112

  • bosit
  • bosit's Avatar
  • OFFLINE
  • Fresh Boarder
  • Posts: 1
If anyone is still having issues with the modal opening and instantly closing it's because of this:
stackoverflow.com/questions/13648979/boo...diately-disappearing

What happens is the moment you click the button, RSForm reloads the bootstrap Javascript, causing the event to be fired twice.

The solution:
Either: DONT use a boostrap template for the form
OR: Go to form properties and uncheck Load Layout CSS / JS under options
The administrator has disabled public write access.

How to popup a form? 3 years 9 months ago #40412

Macroscoop wrote:
Hi,

The javascript for the thank you page is working perfect. Only when the visitor enters wrong information and submits the information the Modal closes. When you press the bootstrap button to open the form - the form opens again but with the red validation errors. Is there additional javascript available which respects the RS FORM validation?

<script>jQuery(document).ready(
function(){
jQuery('#myModal').modal(); });
</script>

Joomla 3.4.3
RS FORMS Pro

Did this work with Bootstrapt 3? Also, where did you put the <script> code?
The administrator has disabled public write access.

How to popup a form? 3 years 4 days ago #41173

  • pay4
  • pay4's Avatar
  • OFFLINE
  • Fresh Boarder
  • Posts: 6
I have also a question. If I want 2 or more different forms in an article to popup on click, is there a code for this? Because now when I add the same code for the popup for another form, only 1 form in the 2 popups will appear.

Thanks already,
Kiona
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!