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

  • Home
  • SEARCH
  • 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 9125523
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T06:49:24+00:00 2026-06-17T06:49:24+00:00

So I am loading an html page with a basic script and a basic

  • 0

So I am loading an html page with a basic script and a basic form. However when the page loads there are two radio buttons the user can select, YES or NO. If you the user selects neither, I would like to present an alert box. I successfully present the alert box, but when the user clicks the “okay” button within the alert box the user is redirected to a different page. I added the statement, return false; in hopes that this wouldn’t happen.

The code is as follows,

<!-- Javascript radiobutton form validation -->

<script type="text/javascript">

function valForm(form) {

    if(!document.getElementById('splash_false').checked && !document.getElementById('splash_true').checked  ) {
        alert('You either like splash pages or dislike em, choose one ...please');
        return false;
    }
}

</script>

<!-- Javascript radiobutton form validation END -->


</head>

<body>
<img src="pics/DSCN1566-300x225.jpg" alt="" width="640" height="auto"  />
<h1>Hello Javascript redirection.</h1><br />

<p>
<form name="tosplashornottosplash" action="splash-process.php" method="post">
Splash pages are stupid.

<input type="radio" name="splash" id="splash_false" value="false" /> No
<input type="radio" name="splash" id="splash_true" value="true" /> Yes

<input type="submit" name="splashSubmit" onClick="return valForm(tosplashornottosplash)" value="Enter" />
</form>
</p>
  • 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-17T06:49:25+00:00Added an answer on June 17, 2026 at 6:49 am

    You should place your handler in the form’s onsubmit callback

    <form onsubmit="return valForm(this)" action="splash-process.php" method="post">
    

    Returning false to the onsubmit handler will prevent your form from being posted

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

Sidebar

Related Questions

Is there a way to run a python script when loading an HTML page,
I got this jQuery pre-loading script running on a index.html page loading about 10Mb
In one of my HTML page dynamically loading some file field while clicking a
I want to show page loading spinner in my html page content using jquery
i'm loading external contents inside a page with .load() . in my index.html i
i'm loading, using the JQuery ajax() method, an external page with both html and
I'm loading an HTML page in an iframe and trying to set the font-size
Hey all i am having some problems with loading an HTML page using jQuery's
I'm loading html page via Ajax. Here's the data: <input type=checkbox name=dis_net id=dis_net value=1
I am loading an html page within the body of a landing page via

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.