Welcome, Guest
Username: Password: Remember me

TOPIC: on Submit open a dialog box.

on Submit open a dialog box. 2 years 1 month ago #86435

  • pramesh
  • pramesh's Avatar
  • OFFLINE
  • Fresh Lemon
  • Posts: 3
  • Karma: 0
Hi All,

I am new to all the coding stuff, so it will be of great help if anyone can suggest how can i do this. my requirement is.

WHEN THE USER PRESSES THE SUBMIT BUTTON HE SHOULD GET A DIALOG BOX SAYING "This is your final submission of survey" AND 2 BUTTONS AS Submit / Go back"

Please help.

Regards,
Pramesh.
The administrator has disabled public write access.

Re: on Submit open a dialog box. 2 years 1 month ago #86493

  • tpartner
  • tpartner's Avatar
  • OFFLINE
  • LimeSurvey Team
  • Posts: 4367
  • Thank you received: 828
  • Karma: 381
You can use the JavaScript confirm() method.

1) Set up your survey to use JavaScript.

2) Add the following script to the source of the one of the questions on the page.

When the submit button is clicked, the script will pop up a dialogue. If the respondent clicks "OK" the survey submits, if they click "Cancel" nothing happens.
<script type="text/javascript" charset="utf-8">
 
	$(document).ready(function() {
 
		// Interrupt the submit function
		$('#movenextbtn, #movesubmitbtn').click(function(){
			if(confirm('This is your final submission of survey. Do you want to continue?')) { 
				return true;
			}
			else { 
				return false;
			}
		});
	});
 
</script>
Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.

LimeSurvey is open-source and run entirely by volunteers so please consider donating to support the project.
The administrator has disabled public write access.
The following user(s) said Thank You: pramesh

Re: on Submit open a dialog box. 2 years 1 month ago #86496

  • pramesh
  • pramesh's Avatar
  • OFFLINE
  • Fresh Lemon
  • Posts: 3
  • Karma: 0
Thank You very much Tony. Greatly appreciate your help. Its working perfectly.


Best Regards,
Pramesh.
Last Edit: 2 years 1 month ago by pramesh.
The administrator has disabled public write access.
Moderators: ITEd
Time to create page: 0.098 seconds
Donation Image