Welcome, Guest
Username: Password: Remember me

TOPIC: how to locate url after click button?

how to locate url after click button? 10 months 1 day ago #109478

  • iscar
  • iscar's Avatar
  • OFFLINE
  • Gold Lime
  • Posts: 226
  • Thank you received: 1
  • Karma: 0
version2.0.when user click button, will go to next question.
in a particular question, i would like user to a url instead of next question.
i add jquery as:
$('#movenextbtn').click(function(){window.location.href="http://www.example.com"});

but it still go to next question.
i think it's because
<button class='submit' type='submit' onclick="javascript:document.limesurvey.move.value = 'movenext';
is onclick should be prior to click()?
how to locate url instead of next question?
The administrator has disabled public write access.

how to locate url after click button? 10 months 23 hours ago #109487

  • DenisChenu
  • DenisChenu's Avatar
  • OFFLINE
  • Moderator Lime
  • Posts: 6953
  • Thank you received: 930
  • Karma: 278
Hi,

Tested in 200.sondages.pro/index.php/survey/index/...31/newtest/Y/lang/en
<script>
$(document).ready(function () {
    $("#movenextbtn").click(function(e){
        if($("#answer{SGQ}").val()==""){
            e.preventDefault();
            window.location.href="http://example.com";
        }else{
            // Do something other, here : default
        }
    });
});
</script>
Last Edit: 10 months 21 hours ago by DenisChenu. Reason: {SQG} to {SGQ}
The administrator has disabled public write access.
The following user(s) said Thank You: iscar

how to locate url after click button? 10 months 21 hours ago #109489

  • iscar
  • iscar's Avatar
  • OFFLINE
  • Gold Lime
  • Posts: 226
  • Thank you received: 1
  • Karma: 0
when i input something, it still goto example.com
The administrator has disabled public write access.

how to locate url after click button? 10 months 21 hours ago #109490

  • DenisChenu
  • DenisChenu's Avatar
  • OFFLINE
  • Moderator Lime
  • Posts: 6953
  • Thank you received: 930
  • Karma: 278
Youre rigth: SGQ and not SQG .....

Corrected the link : 200.sondages.pro/index.php/survey/index/...31/newtest/Y/lang/en

With the newtest/Y to anwer to another question (be sure to have the las Expression Manager)
The administrator has disabled public write access.

how to locate url after click button? 1 month 3 weeks ago #117155

  • surveyman
  • surveyman's Avatar
  • OFFLINE
  • Fresh Lemon
  • Posts: 9
  • Karma: 0
Interesting script. I was looking for something like this. Did you just copy/paste the script into the question or question group?
The administrator has disabled public write access.

how to locate url after click button? 1 month 3 weeks ago #117157

  • DenisChenu
  • DenisChenu's Avatar
  • OFFLINE
  • Moderator Lime
  • Posts: 6953
  • Thank you received: 930
  • Karma: 278
In question text or help.
Using SGQ then in question text.
The administrator has disabled public write access.
The following user(s) said Thank You: surveyman
Moderators: ITEd
Time to create page: 0.203 seconds
Donation Image