CONTACT TECHNOGEEK WITH YOUR QUERY

"Technogeek: Send us a query or message!"

Email Us

Slightly delay may occur due to A.I. Spam Combat



Over 100 Five Star Google Reviews

PC Protection Services by Technogeek

FIXED FEE WORKSHOP & REMOTE SERVICES

Office Address

13 Stokes Street North Lakes


Office Hours

WEEKDAYS: 8am to 6:30pm
SAT: 9am to 12pm

CLOSED SUNDAYS & PUBLIC HOLIDAYS

``` ### Changes Made: 1. **Subtraction Operator Fix**: When the subtraction operator is chosen (`"-"`), the script now checks if `num1` is less than `num2`. If so, it swaps `num1` and `num2` to ensure that the result is a non-negative integer. This change will prevent the generation of CAPTCHA questions that involve impossible or negative answers, making the CAPTCHA both effective and user-friendly. ``` ### Explanation: 1. **CAPTCHA Generation**: - The `generateCaptcha` function creates two random numbers between 1 and 10 and randomly selects either an addition or subtraction operation. - It then calculates the correct answer and returns an object with the question (e.g., "What is 3 + 4?") and the answer. 2. **Displaying the CAPTCHA**: - The CAPTCHA question is displayed in the `CaptchaDiv` element, and the correct answer is stored in a hidden input field (`txtCaptcha`). 3. **Validation**: - The `ValidCaptcha` function checks if the user's input matches the correct answer. This script will replace your current CAPTCHA system with a math-based question that users must solve to proceed.