• 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: Multipage Form with back button and Select input

Multipage Form with back button and Select input 17 years 2 months ago #1793

Hi everyone,

I'm newbie in RSform and i got a little trouble :blush: .

I need to build a multipage form witch has a back button. With the normal input fields everithing gone fine, but when i need to retrive form $_SESSION the value of selected field and assign it back to the Select field I found that the [default_value] stores a part of the definition code of the select. I found the same situation with radio button fields.

I the code for refill the field in the 'Script called on form display' area. It's the right palce?

What is the best way to catch back the value of a Select or Radio Button and redraw it correct?

Related with that, when I go forward in the forms collection, witch propertie of field object stores the selected value form the Select input?

Thanks
The administrator has disabled public write access.

Re:Multipage Form with back button and Select input 17 years 2 months ago #1799

I'm think I found the solution :lol: : in the 'Script called on form display' script area I put the next function wich recive the default value of the field, the session stored value and the string with the mark sign like {checked}, {selected}.

I post the possible solution. In my cases works fine, but if some one try it, let me know about the troubles.
<?php
function setSTATE($strDefaultValue,$strSessionValue,$markText) {
	$holder = array ( );
	$arrInputEntries = explode ( ',', $strDefaultValue );
	foreach ( $arrInputEntries as $inputEntry ) {
		$arrEntryValues = explode ( '|', $inputEntry );
		$strAux = stristr ( $arrEntryValues [0], $strSessionValue );
		//is the value stored in the session
		if ($strAux) {
			//isn't marked
			if (strlen ( $strAux ) == strlen ( $strSessionValue )) {
				$arrEntryValues [0] .= $markText;
			}
		} else //isn't the value stored in the session
		{
			//is marked
			if (stristr ( $arrEntryValues [0], $markText )) {
				$size = (strlen ( $arrEntryValues [0] ) - strlen ( $markText ));
				$strAux2 = substr ( $arrEntryValues [0], 0, $size );
				$arrEntryValues [0] = $strAux2;
			}
		}
		array_push ( $holder, implode ( '|', $arrEntryValues ) );
	}
	return (implode ( ',', $holder ));
}
?>
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!