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 955253
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T00:21:01+00:00 2026-05-16T00:21:01+00:00

I have an HTML form that uses a PHP file in the form tag

  • 0
  1. I have an HTML form that uses a PHP file in the form tag action=”” for sending the content of the form as an email.

  2. I have a simple JavaScript for required fields that is called for in the form tag onsubmit=””.

  3. My PHP file returns a summary of the form after it is submitted.

All I need to add is a simple confirmation dialog box. But I’m having trouble figuring out how to do that. (Sorry, I should be a little more brilliant!) I could probably add JavaScript to my required fields code, but not sure how to do that. Here is my existing code:

function validate_required(field,alerttxt)
{
with (field)
{
if (value==null||value=="")
{
alert(alerttxt);return false;
}
else
{
return true;
}
}
}

function validate_form(thisform)
{
with (thisform)
{
if (validate_required(drop_point,"Please choose a Drop Point")==false)
{drop_point.focus();return false;}
if (validate_required(your_name,"Please enter your Name")==false)
{your_name.focus();return false;}
if (validate_required(email,"Please enter your Email Address")==false)
{your_name.focus();return false;}
}

}

Any help would be appreciated! Thanks!

  • 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-05-16T00:21:01+00:00Added an answer on May 16, 2026 at 12:21 am

    Shoban got me going and here is what my solution is:

    function validate_form(thisform)
    {
    with (thisform)
    {
    if (validate_required(drop_point,"Please choose a Drop Point")==false)
    {drop_point.focus();return false;}
    if (validate_required(first_name,"Please enter your First Name")==false)
    {first_name.focus();return false;}
    if (validate_required(last_name,"Please enter your Last Name")==false)
    {last_name.focus();return false;}
    if (validate_required(drop_point_date,"Please enter the Drop Point Date")==false)
    {drop_point_date.focus();return false;}
    if (validate_required(email,"Please enter your Email Address")==false)
    {email.focus();return false;}
    if (validate_required(order_confirm,"Please confirm your order")==false)
    {order_confirm.focus();return false;}
    }
    return confirm("Do you want to submit the form");
    }
    

    And that works perfect!

    Thanks a lot! Live and learn!

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

Sidebar

Related Questions

I have a HTML form, and I have a Controller Action that accepts the
I have a site that has a simple HTML button in a form. All
There are some HTML based games (ie bootleggers.us) that have a simple login form
I have an HTML form - with PHP, I am sending the data of
I have a form on a page that sends data to php file via
I have a form that uses PHP to calculate a total based on the
I have a basic HTML form that gets inserted into a server side div
I have a form on an HTML page with multiple submit buttons that perform
If I have a HTML form with some embedded div s, and after the
Let's say I have an html form. Each input/select/textarea will have a corresponding <label>

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.