Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8961849
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T15:59:15+00:00 2026-06-15T15:59:15+00:00

First time posting here, last alternative to getting even more frustrated with this non-sense.

  • 0

First time posting here, last alternative to getting even more frustrated with this non-sense. I see nothing wrong with this code segment and yet the onsubmit condition seems to be always returning as true, even if I leave the fields blank (which should be verified on the spot).

NOTE: my JS functions are blank at the moment, haven’t gotten that far yet.

Further investigation note: even the final case which I wrote to be a catch all is not working, it’s simply trying to reach the checkout page as soon as I hit submit and completely ignoring the onsubmit.

<?xml version = "1.0" encoding = "utf-8" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml1-strict.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <title> Book registration. </title>
    <script type = "text/javascript" src = 'Script/main.js'></script>
</head>

<body>
    <form method = "POST" action = "Checkout" onsubmit = "validate(this)">      
        <fieldset>
        <legend> Book Registry Access </legend>

        <p> ISBN: <input type = "text" size = "14" name = "ISBN" onchange = "if(this.value != '') ajaxVerif('checkISBN', this.value, this.id);"> </p>
        <p> Title: <input type = "text" size = "32" id = "title" name = "title"> </p>
        <p> Author: <input type = "text" size = "32" id = "author" name = "author"> </p>
        <p> Edition: <input type = "text" size = "2" id = "edition" name = "edition" onchange = "if(this.value != '') ajaxVerif('checkEdi', this.value, this.id);"> </p>
        <p> <input type = "submit"> </p>

        </fieldset>
    </form>
</body>
</html>

    function validate(thisForm)
    {
    if (thisForm.ISBN.value == '') {
                    alert('Please enter a valid ISBN number in the form XXXX-YYYY-ZZZZ');
                    this.ISBN.focus();
                    return false;
                }
    if (thisForm.title.value == '') {
                    alert('Please fill in the title field.');
                    this.title.focus();
                    return false;
                }   
    if (thisForm.author.value == '') {
                    alert('Please fill in the author field.');
                    this.author.focus();
                    return false;
                }
    if (thisForm.edition.value == '') {
                    alert('Please enter a valid edition number.');
                    this.edition.focus();
                    return false;
                }
    alert('Success! This test form is working! (TO BE DELETED!!)');
    return false;
    }

EDIT: edited for cleanliness, still cannot get it to work. So now everything works in terms of verification except, apparently, the returning false. It will always try to jump to the next page (and fail because that links to a dummy page). I am not quite sure why, pretty sure all my returns should be ok.

FINAL EDIT: Fixed, I forgot to write it as onsubmit = ‘return validate(this)’>

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-15T15:59:16+00:00Added an answer on June 15, 2026 at 3:59 pm

    First, avoid inline JavaScript.

    You would have noticed the missing } by keeping a clean JavaScript code.

      if (this.title.value == '') {
        alert('Please fill in the title field.');
        this.title.focus();
        return false;
      }
    --^--
    

    UPDATE

    1. You forgot the return, and

      onsubmit = "return validate(this);"
               ---^^^^^^---         ---^---
      
    2. You also forgot to finish replacing this with thisForm.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

So this is my first time posting here but I'm more or less stumped.
this is my first time posting here, I have a question which I have
this is my first time posting on here and have read alot of helpful
this is my first time posting here, but I didn't know where else to
This is my first time posting a question here, it has been a valuable
First time posting here, will try to be succinct. This is a classic 'can't
This is my first time posting here, so I apologize in advance for the
This is my first time posting here, but I've found a lot of answers
this is my first time posting a question here - I've searched for ones
first time posting here, but god know's I use this site to search for

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.