Introduction to JavaScript
When people hear image rotation or slider, they think of large plugins with lots of code, settings and effects. But in many situations it can be done very simply. How?
Do you need to find out whether the user clicked the left or right mouse button or the wheel?
We need this in forms. An example is a shopping cart where the user chooses how to receive the goods – in person or by post. If they choose in person, we do not need the shipping method or even their address, so we set those form fields to disabled. If they choose delivery by post, we remove disabled from the fields again.
As part of protecting forms against spam or malicious code, you also need to validate the extension of the file the user uploads. If you allow, for example, only images, a robot has no way to upload dangerous scripts.