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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T18:42:32+00:00 2026-06-11T18:42:32+00:00

I am new to Netbeans . I have created a simple php project. It

  • 0

I am new to Netbeans. I have created a simple php project. It consists of a form and I’ve written a separate Javascript file to validate its fields. I tried running the project outside netbeans, it works fine. I recently imported the project to netbeans but javascript doesn’t seem to work well. When I try opening the page(form page) in the browser, the entire javascript file appears on the page.
I do not know where I’m going wrong. As I’m new to netbeans I am unable to rectify it. Kindly help.

My Javascript file is named Validation.js and is in the js folder.

function ValidateForm(theForm)
{
  //returns true/false after validation 
}

My php file looks similar to this.

<?php include "js/Validation.js"; 
  //if validation returns true
 if(isset($_POST))
 {
    if(isset ($_POST['bt_save']) && $_POST['bt_save'] == 'Submit')
    {
         //code to insert fields into database after validation
    }
 }
?>
<form method="post" name="form1" id="form1" onsubmit="return ValidateForm(this);">
 <!--form elements-->
 <input type="submit" name="bt_save" value="Submit"/>
</form>

Thanks in advance!

  • 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-11T18:42:34+00:00Added an answer on June 11, 2026 at 6:42 pm

    Your include is wrong, if you use php include it just loads the page.

    Try using <script type="text/javascript" src="js/Validation.js"></script>. instead of include "js/Validation.js".

    So your new file would be something like.

    <?php
      //if validation returns true
     if(isset($_POST))
     {
        if(isset ($_POST['bt_save']) && $_POST['bt_save'] == 'Submit')
        {
             //code to insert fields into database after validation
        }
     }
    ?>
    <form method="post" name="form1" id="form1" onsubmit="return ValidateForm(this);">
     <!--form elements-->
     <input type="submit" name="bt_save" value="Submit"/>
    </form>
    <script type="text/javascript" src="js/Validation.js"></script>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am using NetBeans IDE and have created a new project. The new project
I have a question. I created a new project with netbeans and have main.java
I have created a new project as a PHP Application from Remote Server. I
I'm trying to create a new project in NetBeans PHP from existing sources. When
I have a GUI written using netbeans with a few simple components in place.
I have created several files with unit tests on existing classes in NetBeans project.
I have created a fresh new Java EE 6 Enterprise-Application in Netbeans 7.2. So
I have a simple webservice created with Netbeans 6.5 and deployed into 2 glassfish
I have created a new DesktopApplication in Netbeans. When I start it, it shows
i am new to netbeans ide , i have a swing desktop application and

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.