• 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: display thankyou in place of form using mod_forme

display thankyou in place of form using mod_forme 17 years 1 month ago #2923

  • epnm
  • epnm's Avatar
  • OFFLINE
  • Fresh Boarder
  • Posts: 2
Hallo

Is it possible to display the thankyou message inplace of the form when using mod_forme.
So after the user submits the form and the validation is passed, instead of redirecting to a 'thank you page' it displays the same page the form is on with the form replaced by the thank you text.
If it is not possible natively, how would i hack the code in mod_forme.php to achieve this?

many thanks
The administrator has disabled public write access.

Re:display thankyou in place of form using mod_for 17 years 1 month ago #2924

  • epnm
  • epnm's Avatar
  • OFFLINE
  • Fresh Boarder
  • Posts: 2
Hacked this by changing this code in the processForm_module() function in mod_forme.php
if(strlen($form->thankyou)!=0){
				if(isset($_SESSION['formdata'])){
					unset($_SESSION['formdata']);
				}
				// HACKED by Edd P 12-05-2008
				//mosRedirect(sefRelToAbs(\"index.php?option=com_forme&Itemid=$Itemid&func=thankyou&did=$data_id\"«»));
				// redirect back to the same page. add a thankyou and did GET var
				mosRedirect(sefRelToAbs($_SERVER['REQUEST_URI'] . \"&thankyou=1&did=$data_id\"«»));
 
			}else {
			... etc

i added this to the top of the showForm_module() function
		// HACKED by Edd P 12-05-2008
		// if the thankyou GET var is set then display the thankyou message followed by the form
		$thankyou = mosGetParam( $_GET, 'thankyou', array());
		$did = mosGetParam( $_GET, 'did', array());
		$elpath = $mosConfig_absolute_path.'/components/com_forme';
 
		if($thankyou){
			require_once( $mainframe->getPath( 'class','com_forme' ) );
			thankyou( \"com_forme\", $did );
		}
		...etc

i also had to copy the thankyou() function from forme.php into the mod_forme.php file.

The result is that the thank you message gets displayed with the form underneath.
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!