Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

184
Views
Mitigate user removing required field from form

I have a few forms for signing in/up or continuing as guest using the firebase. I want the user to be forced to put in an email so I can identify the user when they come to pick up their order and send them a receipt after they've paid. There is nothing preventing the user from just inspecting element and removing the required field, and the firebase functions are called from the front end so I cant even use my server to double check there is an email.

Is there a way to mitigate this? Aside from Firebase specific solutions, is there a way to mitigate this issue with all required fields? There is obviously a way as other websites implement this but I'm not sure how

Maybe run a script to check if the required attribute has been removed but that too can be deleted or edited.

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

You can check if the field in question exists and has a value.

const form = document.forms.form;

form.onsubmit = () => {
  event.preventDefault();
  signInAnonymously(event.currentTarget.elements.email);
};

function signInAnonymously(email) {
  if (email && email.value) {
    console.log("Authenticate with Firebase anonymously");
  } else {
    console.log("Email is required")
  }
}
<form name="form">
<label>
  <b>Email:</b>
  <input name="email" type="email" required>
</label>
<button>Sign In Anonymously</button>
</form>

about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!