简体   繁体   中英

jQuery event triggered by space

I'm trying to have a next button disabled untill 30 seconds after the space bar has been pressed using jQuery in qualtrics. I've tried a lot of suggestions that have already been made, but nothing seems to work. If anyone could help me out here I'd be super grateful, I'm at a real dead end.

Thanks in advance

Qualtrics.SurveyEngine.addOnload(function() {
  /*Place Your Javascript Below This Line*/
  var InputId = $("QR~" + this.questionId);
  InputId.style.display = "none";
  this.disableNextButton();
  if (e.keyCode === 0 || e.keyCode === 32) {
    this.enableNextButton.delay(30);
  }
})

$ in Qualtrics is referring to prototypejs. You would need to run jquery noconflict to be using jquery, and using the correct identifier to match.

Additionally, you have no event handler to capture your keypress.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM