Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Help with back/previous function #8

Open
zolodeveloper opened this issue Aug 28, 2019 · 3 comments
Open

Help with back/previous function #8

zolodeveloper opened this issue Aug 28, 2019 · 3 comments

Comments

@zolodeveloper
Copy link

Hi guys

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

@zolodeveloper zolodeveloper changed the title Help with back/previous Help with back/previous function Aug 28, 2019
@einarberglund
Copy link

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)
			}
		});

@captainscorch
Copy link

@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?

@einarberglund
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants