0

I am using Qualtrics survey software and experiencing issues with bots. Their own bot detection tools are not sufficient.

I want to detect if a bot is completing the form. To do so, I thought I would change the colors of one field to be all white (same color as the background). The following CSS is not working to do so:

#ID > * {
  background-color: white !important;
  color: white ! important;
}

The following JavaScript is also not working:

var nodes = document.getElementById('ID').childNodes;
for(var i = 0; i < nodes.length; i++){
    if(nodes[i].nodeName.toLowerCase() == 'div'){
        nodes[i].style.backgroundColor = 'white !important';
        nodes[i].style.color = 'white !important';
    }
}

How do I target an element and all its child elements and make them invisible to the human eye, but not a computer?

MWE on Qualtrics

https://uwartsandsciences.sjc1.qualtrics.com/jfe/form/SV_5sYhuvDNJcRpdS6

The first question (ID == QID1) I want hidden from the human eye. The second can remain visible.

Brigadeiro
  • 2,649
  • 13
  • 30
  • 1
    `I want to detect if a bot is completing the form. To do so, I thought I would change the colors of one field to be all white (same color as the background)` -- Just out of curiosity, what exactly is the purpose of serving white background & text input field to a bot? – AndrewL64 Aug 03 '21 at 18:48
  • @AndrewL64, a human would not see this input and would skip it. A bot would see this input, however, and select a response. – Brigadeiro Aug 03 '21 at 18:50
  • @David perhaps it has to do with Qualtrics itself. Here's a MWE to play with: https://uwartsandsciences.sjc1.qualtrics.com/jfe/form/SV_5sYhuvDNJcRpdS6 #QID1 and it's children I want to hide. – Brigadeiro Aug 03 '21 at 18:55
  • Why not just use `visibility: hidden;`, a simple JS math challenge or a captcha instead? – AndrewL64 Aug 03 '21 at 19:04
  • You probably meant `#ID * { background-color: white !important; color: white ! important; }` When you add the `>`, that makes it apply to only the immediate children. – Ruan Mendes Aug 03 '21 at 19:05
  • hidefrom('humans');hidefrom(!'bots') – Amini Aug 03 '21 at 19:30

1 Answers1

1
display: none;

have that on the input field you want hidden if what you are trying to do is set up a honeypot.

Humans will not see it but the bots will see it as they are reading the html.

Honeypot implementation

J. Cutshall
  • 302
  • 3
  • 13