Windows 10 reached EOS (end of support) on October 14, 2025. If you are on Windows 10, see this article.

Hilfe durchsuchen

Vorsicht vor Support-Betrug: Wir fordern Sie niemals auf, eine Telefonnummer anzurufen, eine SMS an eine Telefonnummer zu senden oder persönliche Daten preiszugeben. Bitte melden Sie verdächtige Aktivitäten über die Funktion „Missbrauch melden“.

Weitere Informationen
Gelöst

Native Form Validation Not Working

eugbug1

ChatGPT wrote code for me for an electricity cost calculator. The Boolean "required" attribute is used for several <input> elements. This is supposed to cause the browser to popup a notification if data isn't entered in the panels when the Submit button is clicked/tapped on a form. Now this works on Windows using the Firefox browser, and in the Chrome app on Android, but not in the Firefox app on Android. Android version is 16. Firefox is v159.0

This is an example of the code for a text input box:

     <label>Electricity unit cost (per kWh in cent or pence)</label>
     <input id="ec-rate" required="" type="number" />


The attached screenshot shows what the Chrome app does, popping up a notification to enter data if nothing was entered before submitting the form. Firefox just doesn't do anything when I tap the Submit button. ChatGPT added a secondary data check in JS to cater for the scenario where a form is submitted with no entries in the hours or time boxes. I removed the required attribute in the code for these boxes so that either box could be left unfilled (a user can enter hours or minutes without having to enter both).

ChatGPT wrote code for me for an electricity cost calculator. The Boolean "required" attribute is used for several <input> elements. This is supposed to cause the browser to popup a notification if data isn't entered in the panels when the Submit button is clicked/tapped on a form. Now this works on Windows using the Firefox browser, and in the Chrome app on Android, but not in the Firefox app on Android. Android version is 16. Firefox is v159.0 This is an example of the code for a text input box: <div class="ec-field"> <label>Electricity unit cost (per kWh in cent or pence)</label> <input id="ec-rate" required="" type="number" /> </div> The attached screenshot shows what the Chrome app does, popping up a notification to enter data if nothing was entered before submitting the form. Firefox just doesn't do anything when I tap the Submit button. ChatGPT added a secondary data check in JS to cater for the scenario where a form is submitted with no entries in the hours or time boxes. I removed the required attribute in the code for these boxes so that either box could be left unfilled (a user can enter hours or minutes without having to enter both).
Angefügte Screenshots

Geändert am von eugbug1

Diese Antwort im Kontext lesen

Ausgewählte Lösung

You're not doing anything wrong, we don't support it yet. It's a painful issue, not resolved since the beginning.

Alle Antworten (3)

I don't see any questions here. Do you have any?

TyDraniu said

I don't see any questions here. Do you have any?

On the 4th line. I'm reporting an issue. My question is am I doing something wrong or do I have to change the settings in my browser to make these notifications work? The code is working on other browsers. Maybe Firefox doesn't support these validation checks. It does on desktop.

Geändert am von eugbug1

Ausgewählte Lösung

You're not doing anything wrong, we don't support it yet. It's a painful issue, not resolved since the beginning.

Stellen Sie eine Frage

Sie müssen sich mit Ihrem Benutzerkonto anmelden, um auf Beiträge zu antworten. Bitte stellen Sie eine neue Frage, wenn Sie noch kein Benutzerkonto haben.