FullscreenForm icon indicating copy to clipboard operation
FullscreenForm copied to clipboard

Help with back/previous function

Open zolodeveloper opened this issue 5 years ago • 3 comments

Hi guys

I need the back/previous function for this form script.. kindly help a friend. THANKS

zolodeveloper avatar Aug 28 '19 18:08 zolodeveloper

Just add this code below to get a prev btn! :-)

		/* 
			 New go to prev btn 
			 Step 1: Add a button to the form with ID == 'prevBtn'
			 Step 2: Add this code below inside the block - FForm.prototype._initEvents = function() { }
			 
		*/
		var prevBtn = document.getElementById('prevBtn')
		
		prevBtn.addEventListener('click', function() {
			if (!self.current == 0) {
				self._nextField(self.current - 1)
			}
		});

einarberglund avatar Dec 27 '19 16:12 einarberglund

@einarberglund Thank you for providing this solution, I gave it a try but as soon as I go back within the form the survey breaks and in the console it shows several errors too. Does that happen for you to or is it working fine?

captainscorch avatar Dec 31 '19 10:12 captainscorch

@captainscorch No worries, I do not get any errors at all! I have however modified the Form quite a lot!

einarberglund avatar Jan 02 '20 09:01 einarberglund