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

218
Views
how to link submit button to another page in html

i am trying to submit a set of input and then go to a certain html page(view.html) but cant figure it out, if i use action, it won't submit the value to the database. i also used onclick on the submit button, but it wont submit the values to the database

const firebaseConfig = {
  apiKey: "",
  authDomain: "",
  databaseURL: "",
  projectId: "",
  storageBucket: "",
  messagingSenderId: "",
  appId: ""
};
firebase.initializeApp(firebaseConfig);
var db = firebase.database();

const sendMessage = () => {

  let sender = document.getElementById("sender").value.trim();
  let reciever = document.getElementById("reciever").value.trim();
  let message = document.getElementById("message").value.trim();
  db.ref("card").push().set({
    "sender": sender,
    "reciever": reciever,
    "message": message
  });
  document.forms[0].reset();
  let message1 = document.getElementById("message")
  message1.value = ""
  return false;
}
<form onsubmit="return sendMessage();" class="form_container ">


  <input type="text" name="" id="sender" class="card_name mx-auto" placeholder="Your Name" autocomplete="off">
  <input type="text" name="" id="reciever" class="card_name_reciever mx-auto" placeholder="To who" autocomplete="off">
  <textarea class="card_message mx-auto" id="message" placeholder="Message..."></textarea>
  <input type="submit" class="card_submit mx-auto" id="card_submit">


</form>

about 4 years ago · Santiago Trujillo
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!