Welcome, Guest
Username: Password: Remember me

TOPIC: smiley face without radiobutton and submitting

Re: smiley face without radiobutton and submitting 2 years 11 months ago #70720

  • floccs
  • floccs's Avatar
  • OFFLINE
  • Senior Lime
  • Posts: 47
  • Thank you received: 5
  • Karma: 2
I think you can add the submit() at the end of the selectface() function
The administrator has disabled public write access.

Re: smiley face without radiobutton and submitting 2 years 11 months ago #70721

  • toma
  • toma's Avatar
  • OFFLINE
  • Fresh Lemon
  • Posts: 11
  • Karma: 0
Then form is submitted automatically. At least how I put it there.
    function selectface(face) {
 
        $('.face').removeClass('selected');
        $('#question66 input.radio:eq('+face+')').attr('checked', true);
        $('.num'+face).addClass('selected');
 
	$('form#limesurvey').submit();
 
    }
OR (when it will wait for a while before submitting)
    function selectface(face) {
 
        $('.face').removeClass('selected');
        $('#question66 input.radio:eq('+face+')').attr('checked', true);
        $('.num'+face).addClass('selected');
 
	setTimeout(function() { 
		$('form#limesurvey').submit();
	}, 500);
 
    }

So selectface-function goes on before actually selecting anything.
Last Edit: 2 years 11 months ago by toma.
The administrator has disabled public write access.

Re: smiley face without radiobutton and submitting 2 years 11 months ago #70723

  • floccs
  • floccs's Avatar
  • OFFLINE
  • Senior Lime
  • Posts: 47
  • Thank you received: 5
  • Karma: 2
You can also remove the lines with removeClass and addClass since the form is submitted automatically and you don't need styling of the selected image
The administrator has disabled public write access.

Re: smiley face without radiobutton and submitting 2 years 11 months ago #70727

  • toma
  • toma's Avatar
  • OFFLINE
  • Fresh Lemon
  • Posts: 11
  • Karma: 0
I am not sure did make myself clearly. Form submits itself before user clicks on a smiley face. So right now this (combination of two alternatives) doesn't work.
The administrator has disabled public write access.

Re: smiley face without radiobutton and submitting 2 years 11 months ago #70730

  • tpartner
  • tpartner's Avatar
  • OFFLINE
  • LimeSurvey Team
  • Posts: 4360
  • Thank you received: 826
  • Karma: 381
I don't understand why you need to combine the two solutions if you want to imediately submit the form and don't need the "selected" effects.
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.

Re: smiley face without radiobutton and submitting 2 years 11 months ago #70731

  • toma
  • toma's Avatar
  • OFFLINE
  • Fresh Lemon
  • Posts: 11
  • Karma: 0
Reason is that it would be nice, if images would be links so cursor would change above them.
The administrator has disabled public write access.

Re: smiley face without radiobutton and submitting 2 years 11 months ago #70732

  • tpartner
  • tpartner's Avatar
  • OFFLINE
  • LimeSurvey Team
  • Posts: 4360
  • Thank you received: 826
  • Karma: 381
You can do that with CSS:
#questionQQ label img {
	cursor: pointer;
}
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.

Re: smiley face without radiobutton and submitting 2 years 11 months ago #70733

  • toma
  • toma's Avatar
  • OFFLINE
  • Fresh Lemon
  • Posts: 11
  • Karma: 0
That is so true...

Thanks!
The administrator has disabled public write access.

Re: smiley face without radiobutton and submitting 2 years 11 months ago #70735

  • toma
  • toma's Avatar
  • OFFLINE
  • Fresh Lemon
  • Posts: 11
  • Karma: 0
"Luckily" there is something else which doesn't work with this:
<script type="text/javascript" charset="utf-8">
 
	$(document).ready(function(){
 
		$('#question61 label img').click(function(){
			setTimeout(function() { 
				$('form#limesurvey').submit();
			}, 500);
		});
	});
 
</script>

Scaling seems to be impossible (or at least it needs something that I cannot do). But with that another method it can be done, because I can put html code to that. Maybe some more experienced person can do same with this one also.
The administrator has disabled public write access.

Re: smiley face without radiobutton and submitting 2 years 11 months ago #70736

  • tpartner
  • tpartner's Avatar
  • OFFLINE
  • LimeSurvey Team
  • Posts: 4360
  • Thank you received: 826
  • Karma: 381
some more experienced person
????

"Scaling" has nothing to do with this. That would depend on what images you put in the labels.
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.
Moderators: ITEd
Time to create page: 0.294 seconds
Donation Image