on Submit open a dialog box.

More
4 years 8 months ago #86435 by pramesh
pramesh created the topic: on Submit open a dialog box.
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.

Please Log in to join the conversation.

More
4 years 8 months ago #86493 by tpartner
tpartner replied the topic: on Submit open a dialog box.
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.
The following user(s) said Thank You: pramesh

Please Log in to join the conversation.

More
4 years 8 months ago - 4 years 8 months ago #86496 by pramesh
pramesh replied the topic: on Submit open a dialog box.
Thank You very much Tony. Greatly appreciate your help. Its working perfectly.


Best Regards,
Pramesh.
Last Edit: 4 years 8 months ago by pramesh.

Please Log in to join the conversation.

Start now!

Just create your account and start using Limesurvey today.

Register now